]> git.ipfire.org Git - thirdparty/gcc.git/commit
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)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 08:03:49 +0000 (08:03 +0000)
commit780ebba8a9152598e0fde0528c2fc63d9f474fcd
treebf59145420917214e7efc7a30ef6bd9e11e56f60
parent688b8d8b0e24aa7e2a7f741355d696f60337f956
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]