]> granicus.if.org Git - clang/commitdiff
Slight tweak to alias template error handling: don't guess that a template-id in...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 May 2011 22:36:10 +0000 (22:36 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 May 2011 22:36:10 +0000 (22:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
test/CXX/temp/temp.decls/p3.cpp

index ae6b3ff011eae85a5bf28cb61823f4d197d28f3f..9c464bc248507e2a72fbd7819a4ba07d7eeac3f3 100644 (file)
@@ -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;
index 21c82e6f227449b15bd486a136ab0ccfaa883444..54800e4061ee033ad2995fb154de498044f624d0 100644 (file)
@@ -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}}