c++: Template keyword following :: [PR96082]
authorMarek Polacek <polacek@redhat.com>
Tue, 4 Aug 2020 13:35:25 +0000 (09:35 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 4 Aug 2020 17:41:36 +0000 (13:41 -0400)
commit97def1f34c134d78d4423e9ac3e9b262417ea390
tree54684fc3e421aa904b15fe7674906fc4f004313d
parentacf83db025cfd4a67724838e9dbd19813f4f5960
c++: Template keyword following :: [PR96082]

In r9-4235 I tried to make sure that the template keyword follows
a nested-name-specifier.  :: is a valid nested-name-specifier, so
I also have to check 'globalscope' before giving the error.

gcc/cp/ChangeLog:

PR c++/96082
* parser.c (cp_parser_elaborated_type_specifier): Allow
'template' following ::.

gcc/testsuite/ChangeLog:

PR c++/96082
* g++.dg/template/template-keyword3.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/template/template-keyword3.C [new file with mode: 0644]