]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnose return statement in match.pd (with { ... } expressions
authorRichard Biener <rguenther@suse.de>
Thu, 13 Oct 2022 10:59:09 +0000 (12:59 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 13 Oct 2022 11:48:54 +0000 (13:48 +0200)
commit786e4c024f941671a233f5779d73a5d22f4e9588
tree53acf5ed89d025c51d9961c64f2451a4d9071af4
parent9f0d4adabe2035886a1aa8d2ca990a90de000613
diagnose return statement in match.pd (with { ... } expressions

The expression in (with { ... } is used like a statement expression
which means control flow that leaves it is not allowed.  The following
explicitely diagnoses 'return' and fixes up the few cases that crept
into match.pd (oops).  Any such return will prematurely end matching
the current expression.

* genmatch.cc (parser::parse_c_expr): Diagnose 'return'.
* match.pd: Replace 'return' statements in with expressions
with appropriate variants.
gcc/genmatch.cc
gcc/match.pd