]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: expansion: Only add fragments if the matcher succeeded
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 8 Apr 2025 12:41:16 +0000 (14:41 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 16:23:54 +0000 (18:23 +0200)
commitcb23182fa2b9b06acbd82993be57f3dc47cc62eb
tree83897657d14d6c8eec5836d3cd05b6f1f27d0cd1
parent76477f965552b5872bb14255f272bff78978ef0c
gccrs: expansion: Only add fragments if the matcher succeeded

gcc/rust/ChangeLog:

* expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not
insert fragments and substack fragments if the matcher failed.

gcc/testsuite/ChangeLog:

* rust/compile/macros/mbe/macro-issue3708.rs: New test.
gcc/rust/expand/rust-macro-expand.cc
gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs [new file with mode: 0644]