aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-07-29 12:32:30 +0000
committerGitHub <noreply@github.com>2022-07-29 12:32:30 +0000
commit2d824b796cde571d270f4c20af8183dbd93614d5 (patch)
treead242172f61a255644b98e4f4fd73010b5d770b7 /gcc/testsuite
parent7f1685d7f60c29eeabbd3c556428b67142201df2 (diff)
parent5e63ca064ab52d026112166fd1b6601c61591778 (diff)
downloadgcc-2d824b796cde571d270f4c20af8183dbd93614d5.zip
gcc-2d824b796cde571d270f4c20af8183dbd93614d5.tar.gz
gcc-2d824b796cde571d270f4c20af8183dbd93614d5.tar.bz2
Merge #1421
1421: expand: further improves the handling of recursive macros r=CohenArthur a=liushuyu - expand: further improves the handling of recursive macros. Now all the attribute visitor that expands the macro fragment will recursively expand the macro using the unified expanding function `expand_macro_fragment_recursive` instead of expanding the fragment only once. Fixes #1403 Co-authored-by: liushuyu <liushuyu011@gmail.com>
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/rust/compile/torture/macro-issue1403.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/torture/macro-issue1403.rs b/gcc/testsuite/rust/compile/torture/macro-issue1403.rs
new file mode 100644
index 0000000..7fe6c51
--- /dev/null
+++ b/gcc/testsuite/rust/compile/torture/macro-issue1403.rs
@@ -0,0 +1,23 @@
+macro_rules! stmt {
+ ($s:stmt) => {
+ $s
+ };
+ ($s:stmt, $($ss:stmt),*) => {
+ $s;
+ stmt!($($ss),*);
+ };
+}
+
+fn main() {
+ stmt!(
+ struct S;
+ );
+ stmt!(
+ struct A;,
+ struct B;,
+ struct C;,
+ struct D;,
+ struct E;
+ );
+}
+