aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-06-01 22:37:07 +0000
committerDouglas Gregor <dgregor@apple.com>2011-06-01 22:37:07 +0000
commit95ea45072a46ba3c85fc588aed15509a1a0900ed (patch)
tree793de5eaf51802823c9bc4813a39796a89061ca3
parentaa37f7a87527b1f5ccd54a91e0379a1b7b6d1d05 (diff)
Fix an incorrect warning about explicit template specializations for
nested types, from Michael Han! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132431 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaTemplate.cpp2
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp31
2 files changed, 32 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index ea084b49ee..1aa7364d18 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -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 &&
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
index f141e929a9..f04c544aa4 100644
--- a/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
@@ -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();
+ };
+}