aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-02-06 22:34:55 +0100
committerJakub Jelinek <jakub@redhat.com>2024-02-06 22:34:55 +0100
commit40485378ade83102d7aa30c317f5d6c90c1d232b (patch)
tree659241acfaab490b5a81ca5a3972ceb5466dfcf9 /libsanitizer
parentf2a060820c24724bb48ee006d257c449e4d94b72 (diff)
downloadgcc-40485378ade83102d7aa30c317f5d6c90c1d232b.zip
gcc-40485378ade83102d7aa30c317f5d6c90c1d232b.tar.gz
gcc-40485378ade83102d7aa30c317f5d6c90c1d232b.tar.bz2
c++: Disallow this specifier except for parameter declarations [PR113788]
The deducing this patchset added parsing of this specifier to cp_parser_decl_specifier_seq unconditionally, but in the C++ grammar this[opt] only appears in the parameter-declaration non-terminal, so rather than checking in all the callers of cp_parser_decl_specifier_seq except for cp_parser_parameter_declaration that this specifier didn't appear I think it is far easier and closer to what the standard says to only parse this specifier when called from cp_parser_parameter_declaration. 2024-02-06 Jakub Jelinek <jakub@redhat.com> PR c++/113788 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator. (cp_parser_decl_specifier_seq): Parse RID_THIS only if CP_PARSER_FLAGS_PARAMETER is set in flags. (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER when calling cp_parser_decl_specifier_seq. * g++.dg/parse/pr113788.C: New test.
Diffstat (limited to 'libsanitizer')
0 files changed, 0 insertions, 0 deletions