diff options
author | Marek Polacek <polacek@redhat.com> | 2020-06-09 18:08:45 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-06-10 09:36:02 -0400 |
commit | 4fed5d5dd85e3f5d812d125f692351646a0417cb (patch) | |
tree | e63cab13fc0b63a916193c7171b407ccdd66de2b /contrib | |
parent | 2db262f29a4b1495885b1f23335b6dc363bf1143 (diff) | |
download | gcc-4fed5d5dd85e3f5d812d125f692351646a0417cb.zip gcc-4fed5d5dd85e3f5d812d125f692351646a0417cb.tar.gz gcc-4fed5d5dd85e3f5d812d125f692351646a0417cb.tar.bz2 |
c++: Fix ICE with delayed parsing of noexcept-specifier [PR95562]
Here we ICE because a DEFERRED_PARSE expression leaked to tsubst_copy.
We create these expressions for deferred noexcept-specifiers in
cp_parser_save_noexcept; they are supposed to be re-parsed in
cp_parser_late_noexcept_specifier. In this case we never got around
to re-parsing it because the noexcept-specifier was attached to a
pointer to a function, not to a function declaration. But we should
not have delayed the parsing here in the first place; we already
avoid delaying the parsing for alias-decls, typedefs, and friend
function declarations. (Clang++ also doesn't delay the parsing
for pointers to function.)
gcc/cp/ChangeLog:
PR c++/95562
* parser.c (cp_parser_direct_declarator): Clear
CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
cdk_id.
gcc/testsuite/ChangeLog:
PR c++/95562
* g++.dg/cpp0x/noexcept60.C: New test.
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions