c++: requires-expression and tentative parse [PR94480]
authorJason Merrill <jason@redhat.com>
Tue, 7 Apr 2020 04:45:26 +0000 (00:45 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 8 Apr 2020 05:12:12 +0000 (01:12 -0400)
commit845d451e1f73d8a9a84382c3c6d4fca9c8220403
tree72b481f86d22f55976656952389f782a7316d498
parentf1a6150ecb7b17f068150e98bc107d730604f5b6
c++: requires-expression and tentative parse [PR94480]

The problem here was that cp_parser_requires_expression committing to a
tentative parse confused cp_parser_decltype_expr, which needs to still be
tentative.  The only reason to commit here is to get syntax errors within
the requires-expression, which we can still do when the commit is firewalled
from the enclosing context.

gcc/cp/ChangeLog
2020-04-07  Jason Merrill  <jason@redhat.com>

PR c++/94480
* parser.c (cp_parser_requires_expression): Use tentative_firewall.
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C [new file with mode: 0644]