summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2020-01-17 15:42:11 -0800
committerSaar Raz <saar@raz.email>2020-01-24 02:28:20 +0200
commitab514b91196345ba4c61026e4997871e85ddd97d (patch)
tree953c9e6226fd9cd37dda565b3b11bd6791b81184 /clang/test/Parser/cxx-decl.cpp
parent57f70e387e362d988937b6627461d781ecf09e50 (diff)
downloadbcm5719-llvm-ab514b91196345ba4c61026e4997871e85ddd97d.tar.gz
bcm5719-llvm-ab514b91196345ba4c61026e4997871e85ddd97d.zip
Remove redundant CXXScopeSpec from TemplateIdAnnotation.
A TemplateIdAnnotation represents only a template-id, not a nested-name-specifier plus a template-id. Don't make a redundant copy of the CXXScopeSpec and store it on the template-id annotation. This slightly improves error recovery by more properly handling the case where we would form an invalid CXXScopeSpec while parsing a typename specifier, instead of accidentally putting the token stream into a broken "annot_template_id with a scope specifier, but with no preceding annot_cxxscope token" state. (cherry picked from commit a42fd84cff265b7e9faa3fe42885ee171393e4db)
Diffstat (limited to 'clang/test/Parser/cxx-decl.cpp')
-rw-r--r--clang/test/Parser/cxx-decl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp
index a868904bb36..1914f347d9d 100644
--- a/clang/test/Parser/cxx-decl.cpp
+++ b/clang/test/Parser/cxx-decl.cpp
@@ -238,12 +238,11 @@ namespace PR5066 {
namespace PR17255 {
void foo() {
- typename A::template B<>; // expected-error {{use of undeclared identifier 'A'}}
- // expected-error@-1 {{'template' keyword not permitted here}}
+ typename A::template B<> c; // expected-error {{use of undeclared identifier 'A'}}
#if __cplusplus <= 199711L
+ // expected-error@-2 {{'typename' occurs outside of a template}}
// expected-error@-3 {{'template' keyword outside of a template}}
#endif
- // expected-error@-5 {{expected a qualified name after 'typename'}}
}
}
OpenPOWER on IntegriCloud