aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2021-06-08 17:44:13 -0400
committerMarek Polacek <polacek@redhat.com>2021-06-25 20:12:04 -0400
commitf9c80eb12c58126a94ad869380af5b88b752c06f (patch)
treee1f6c5cb62fee36fcb4813d8da06465e42f0559c /gcc/cp
parent99585d88a090b4c5b7791f7ab62f70eb37b748fa (diff)
downloadgcc-f9c80eb12c58126a94ad869380af5b88b752c06f.zip
gcc-f9c80eb12c58126a94ad869380af5b88b752c06f.tar.gz
gcc-f9c80eb12c58126a94ad869380af5b88b752c06f.tar.bz2
c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
We weren't passing 'flags' to the recursive call to cp_parser_declarator in the ptr-operator case and as an effect, delayed parsing of noexcept didn't work as advertised. The following change passes more than just CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything. I'm now also passing member_p and static_p, as a consequence, two tests needed small tweaks. PR c++/100752 gcc/cp/ChangeLog: * parser.c (cp_parser_declarator): Pass flags down to cp_parser_declarator. Also pass static_p/member_p. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/noexcept69.C: New test. * g++.dg/parse/saved1.C: Adjust dg-error. * g++.dg/template/crash50.C: Likewise.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/parser.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 096580e..02daa7a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22170,12 +22170,10 @@ cp_parser_declarator (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Parse the dependent declarator. */
- declarator = cp_parser_declarator (parser, dcl_kind,
- CP_PARSER_FLAGS_NONE,
+ declarator = cp_parser_declarator (parser, dcl_kind, flags,
/*ctor_dtor_or_conv_p=*/NULL,
/*parenthesized_p=*/NULL,
- /*member_p=*/false,
- friend_p, /*static_p=*/false);
+ member_p, friend_p, static_p);
/* If we are parsing an abstract-declarator, we must handle the
case where the dependent declarator is absent. */