summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp2
-rw-r--r--clang/test/Parser/cxx-class-template-specialization.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 71ee3118c9a..f09aaf5c0bb 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -1272,7 +1272,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
Range.setBegin(SS.getBeginLoc());
Diag(TemplateId->LAngleLoc, diag::err_template_spec_syntax_non_template)
- << Name << static_cast<int>(TemplateId->Kind) << Range;
+ << TemplateId->Name << static_cast<int>(TemplateId->Kind) << Range;
DS.SetTypeSpecError();
SkipUntil(tok::semi, false, true);
diff --git a/clang/test/Parser/cxx-class-template-specialization.cpp b/clang/test/Parser/cxx-class-template-specialization.cpp
new file mode 100644
index 00000000000..f94a85964a7
--- /dev/null
+++ b/clang/test/Parser/cxx-class-template-specialization.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A {
+ template<typename T>
+ void f();
+};
+class A::f<int>;
+// expected-error@-1 {{identifier followed by '<' indicates a class template specialization but 'f' refers to a function template}}
OpenPOWER on IntegriCloud