]> granicus.if.org Git - clang/commitdiff
Fix an incorrect warning about explicit template specializations for
authorDouglas Gregor <dgregor@apple.com>
Wed, 1 Jun 2011 22:37:07 +0000 (22:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 1 Jun 2011 22:37:07 +0000 (22:37 +0000)
nested types, from Michael Han!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132431 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp
test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp

index ea084b49ee50d5d72f93c8af4d54b44387b54b56..1aa7364d183e7d15107225313a6558df40f34dd8 100644 (file)
@@ -1650,7 +1650,7 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
         if (Spec->getSpecializationKind() != TSK_ExplicitSpecialization)
           NeedEmptyTemplateHeader = true;
         else
-          break;
+          continue;
       } else if (Record->getTemplateSpecializationKind()) {
         if (Record->getTemplateSpecializationKind() 
                                                 != TSK_ExplicitSpecialization &&
index f141e929a9c2c36225ea3ebe2601e43ff4ead6d3..f04c544aa4481fe5af0f68c8cf275a1eb395a874 100644 (file)
@@ -176,3 +176,34 @@ namespace PR9913 {
   template<class B>
   class S<A>::F{};
 }
+
+namespace template_class_spec_perClassDecl_nested
+{
+  template <typename T1> struct A {
+    template <typename T2> struct B {
+      template <typename T3> struct C {
+        static void foo();
+      };
+    };
+  };
+
+  template <> struct A<int> {
+    template <typename T2> struct B {
+      template <typename T3> struct C {
+        static void foo();
+      };
+    };
+  };
+
+  template <> template <typename T3> struct A<int>::B<int>::C {
+    static void foo();
+  };
+
+  template <> template <> struct A<int>::B<int>::C<int> {
+    static void foo();
+  };
+
+  template <> template<> template <typename T2> struct A<bool>::B<bool>::C {
+    static void foo();
+  };
+}