aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/ParseDeclCXX.cpp3
-rw-r--r--test/CXX/temp/temp.decls/p3.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index ae6b3ff011..9c464bc248 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -396,7 +396,8 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
// Type alias templates cannot be specialized.
int SpecKind = -1;
- if (Name.getKind() == UnqualifiedId::IK_TemplateId)
+ if (TemplateInfo.Kind == ParsedTemplateInfo::Template &&
+ Name.getKind() == UnqualifiedId::IK_TemplateId)
SpecKind = 0;
if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitSpecialization)
SpecKind = 1;
diff --git a/test/CXX/temp/temp.decls/p3.cpp b/test/CXX/temp/temp.decls/p3.cpp
index 21c82e6f22..54800e4061 100644
--- a/test/CXX/temp/temp.decls/p3.cpp
+++ b/test/CXX/temp/temp.decls/p3.cpp
@@ -4,5 +4,4 @@ template<typename T> using A = int;
template<typename T> using A<T*> = char; // expected-error {{partial specialization of alias templates is not permitted}}
template<> using A<char> = char; // expected-error {{explicit specialization of alias templates is not permitted}}
template using A<char> = char; // expected-error {{explicit instantiation of alias templates is not permitted}}
-// Best guess as to what the user was trying to do: missing template<>.
-using A<char> = char; // expected-error {{partial specialization of alias templates is not permitted}}
+using A<char> = char; // expected-error {{name defined in alias declaration must be an identifier}}