[cfe-commits] r153006 - in /cfe/trunk: lib/Sema/SemaTemplate.cpp test/SemaTemplate/qualified-id.cpp

Douglas Gregor dgregor at apple.com
Sat Mar 17 17:15:42 PDT 2012


Author: dgregor
Date: Sat Mar 17 19:15:42 2012
New Revision: 153006

URL: http://llvm.org/viewvc/llvm-project?rev=153006&view=rev
Log:
Replace a FIXME with a diagnostic when we can't resolve the
nested-name-specifier for a class template declaration. Fixes PR12291.

Modified:
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/test/SemaTemplate/qualified-id.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=153006&r1=153005&r2=153006&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Sat Mar 17 19:15:42 2012
@@ -872,7 +872,8 @@
   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;
     }
 

Modified: cfe/trunk/test/SemaTemplate/qualified-id.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/qualified-id.cpp?rev=153006&r1=153005&r2=153006&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/qualified-id.cpp (original)
+++ cfe/trunk/test/SemaTemplate/qualified-id.cpp Sat Mar 17 19:15:42 2012
@@ -45,3 +45,12 @@
     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}}
+  };
+}





More information about the cfe-commits mailing list