From: Douglas Gregor Date: Sun, 18 Mar 2012 00:15:42 +0000 (+0000) Subject: Replace a FIXME with a diagnostic when we can't resolve the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=957ff27311d444fb87b5b3acb6f44d5de4533b23;p=clang Replace a FIXME with a diagnostic when we can't resolve the nested-name-specifier for a class template declaration. Fixes PR12291. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153006 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 + class Outer2 { + template + template + class Outer2::Inner; // expected-error{{nested name specifier 'Outer2::' for declaration does not refer into a class, class template or class template partial specialization}} + }; +}