c++: ICE with requires-expr and -Wsequence-point [PR105304]
authorPatrick Palka <ppalka@redhat.com>
Tue, 26 Apr 2022 01:49:00 +0000 (21:49 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 26 Apr 2022 01:49:00 +0000 (21:49 -0400)
commitc83b9c54d9dee2dce5d8268472a745b013d166cc
tree3f720156dc7cf3e2092ac714801181cbac50f425
parent288e4c64f6b4806358aabc9b99b2fba72bf04bf6
c++: ICE with requires-expr and -Wsequence-point [PR105304]

Here we're crashing from verify_sequence_points for this requires-expr
condition because it contains a templated CAST_EXPR with empty operand,
and verify_tree doesn't ignore this empty operand only because the
manual tail recursion that it performs for unary expression trees skips
the NULL test.

PR c++/105304

gcc/c-family/ChangeLog:

* c-common.cc (verify_tree) [restart]: Move up to before the
NULL test.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-requires30.C: New test.
gcc/c-family/c-common.cc
gcc/testsuite/g++.dg/cpp2a/concepts-requires30.C [new file with mode: 0644]