c++: Fix ICE on nonsense requires-clause.
authorJason Merrill <jason@redhat.com>
Thu, 6 Feb 2020 21:14:19 +0000 (16:14 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 7 Feb 2020 13:51:12 +0000 (08:51 -0500)
commit82aee6dd61e2a5b4e4b124f896c8403169688f41
treed45df0fc330ed4a44c5ac31be47f4b660b0b37e5
parent3c7a03bc360c3511fae3747a71e579e9fd0824f9
c++: Fix ICE on nonsense requires-clause.

Here we were swallowing all the syntax errors by parsing tentatively, and
returning error_mark_node without ever actually giving an error.  Fixed by
using save_tokens/rollback_tokens instead.

PR c++/92517
* parser.c (cp_parser_constraint_primary_expression): Do the main
parse non-tentatively.
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp2a/concepts-syntax1.C [new file with mode: 0644]