diff options
author | Jason Merrill <jason@redhat.com> | 2024-07-24 16:20:33 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2024-07-24 17:34:44 -0400 |
commit | 8c71830b51e6fd10087ce3f6791de80eb1f10b96 (patch) | |
tree | 09adc92192bb5628480fa1e20d5de988491ff218 /gcc/analyzer/program-state.cc | |
parent | d2fc64c85788c135419cc3dcf5b4fa64558af547 (diff) | |
download | gcc-8c71830b51e6fd10087ce3f6791de80eb1f10b96.zip gcc-8c71830b51e6fd10087ce3f6791de80eb1f10b96.tar.gz gcc-8c71830b51e6fd10087ce3f6791de80eb1f10b96.tar.bz2 |
c++: parse error with -std=c++14 -fconcepts [PR116071]
cp_parser_simple_type_specifier tries a variety of different things that
might qualify as a user-defined type: an actual type-name, a constrained
auto, a CTAD placeholder. In a context where a type-specifier is optional,
this is all tentative. With -std=c++14 -fconcepts, we try type-name and
constrained auto in sub-tentative parses, and when we run out of things to
try we haven't found anything but also haven't failed the outer tentative
parse, so parse_definitely succeeds, discarding the nested-name-specifier.
Fixed by failing if we didn't find anything.
I said in r14-3203 that we should disable this combination of flags if
further problems arise, but this seems like a more general problem that only
happened to occur with just this combination of flags. So it lives on.
PR c++/116071
gcc/cp/ChangeLog:
* parser.cc (cp_parser_simple_type_specifier): Call
cp_parser_simulate_error if nothing worked.
gcc/testsuite/ChangeLog:
* g++.dg/parse/pr116071.C: New test.
Diffstat (limited to 'gcc/analyzer/program-state.cc')
0 files changed, 0 insertions, 0 deletions