public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7473] gccrs: Handle underscore in MacroMatch.
@ 2024-01-16 17:37 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 17:37 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cd73752ad6df6dde49323e0d5facb87dce70fff1

commit r14-7473-gcd73752ad6df6dde49323e0d5facb87dce70fff1
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date:   Fri Apr 7 16:47:54 2023 -0400

    gccrs: Handle underscore in MacroMatch.
    
    gcc/rust/ChangeLog:
    
            * parse/rust-parse-impl.h
            (Parser::parse_macro_match): Handle underscore.
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/macro51.rs: New test.

Diff:
---
 gcc/rust/parse/rust-parse-impl.h      | 1 +
 gcc/testsuite/rust/compile/macro51.rs | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 67c4f6a3fab..c48c71f6ca3 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -2081,6 +2081,7 @@ Parser<ManagedTokenSource>::parse_macro_match ()
 	  case WHILE:
 	  case YIELD:
 	  case IDENTIFIER:
+	  case UNDERSCORE:
 	    // macro fragment
 	    return parse_macro_match_fragment ();
 	  case LEFT_PAREN:
diff --git a/gcc/testsuite/rust/compile/macro51.rs b/gcc/testsuite/rust/compile/macro51.rs
new file mode 100644
index 00000000000..6659486d268
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macro51.rs
@@ -0,0 +1,3 @@
+macro_rules! test {
+    ($_:ident) => {""}
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 17:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 17:37 [gcc r14-7473] gccrs: Handle underscore in MacroMatch Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).