aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-01-05 14:21:34 -0500
committerPatrick Palka <ppalka@redhat.com>2023-01-05 14:21:34 -0500
commit12b0d35ec52375da5652d2b8da74083ab700b9d7 (patch)
treeecadf0ab0e7a9d7b070a5f23921d475de7f1fcb9 /gcc/config
parent9807c31af91326988d083436483f9577296e1f9a (diff)
downloadgcc-12b0d35ec52375da5652d2b8da74083ab700b9d7.zip
gcc-12b0d35ec52375da5652d2b8da74083ab700b9d7.tar.gz
gcc-12b0d35ec52375da5652d2b8da74083ab700b9d7.tar.bz2
c++: class-head parsing and CPP_TEMPLATE_ID access [PR108275]
When tentatively parsing what is really an elaborated-type-specifier containing a template-id first as a class-specifier, we may form a CPP_TEMPLATE_ID token that later gets reused by the fallback parse if the tentative parse fails. These special tokens also capture the access checks that have been deferred while parsing the template-id. But here we form such a token when the access check state is dk_no_check, and so the token captures no access checks. This effectively bypasses access checking for the template-id during the subsequent parse as an elaborated-type-specifier. This patch fixes this by using dk_deferred instead of dk_no_check when parsing the class name of a class-head. PR c++/108275 gcc/cp/ChangeLog: * parser.cc (cp_parser_class_head): Use dk_deferred instead of dk_no_check when parsing the class name. gcc/testsuite/ChangeLog: * g++.dg/parse/access14.C: New test.
Diffstat (limited to 'gcc/config')
0 files changed, 0 insertions, 0 deletions