diff options
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 3 | ||||
-rw-r--r-- | test/SemaTemplate/qualified-id.cpp | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index afa6c0e15b..680e6eaf2e 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -872,7 +872,8 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK, if (SS.isNotEmpty() && !SS.isInvalid()) { SemanticContext = computeDeclContext(SS, true); if (!SemanticContext) { - // FIXME: Produce a reasonable diagnostic here + Diag(NameLoc, diag::err_template_qualified_declarator_no_match) + << SS.getScopeRep() << SS.getRange(); return true; } diff --git a/test/SemaTemplate/qualified-id.cpp b/test/SemaTemplate/qualified-id.cpp index 29eab89d84..64dff1ce23 100644 --- a/test/SemaTemplate/qualified-id.cpp +++ b/test/SemaTemplate/qualified-id.cpp @@ -45,3 +45,12 @@ namespace PR6063 { detail::f(a, b); } } + +namespace PR12291 { + template <typename T> + class Outer2 { + template <typename V> + template <typename W> + class Outer2<V>::Inner; // expected-error{{nested name specifier 'Outer2<V>::' for declaration does not refer into a class, class template or class template partial specialization}} + }; +} |