[cfe-commits] r80491 - in /cfe/trunk: lib/Sema/SemaCXXScopeSpec.cpp test/SemaCXX/missing-members.cpp

Anders Carlsson andersca at mac.com
Sun Aug 30 00:09:50 PDT 2009


Author: andersca
Date: Sun Aug 30 02:09:50 2009
New Revision: 80491

URL: http://llvm.org/viewvc/llvm-project?rev=80491&view=rev
Log:
More missing member goodness.

Modified:
    cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
    cfe/trunk/test/SemaCXX/missing-members.cpp

Modified: cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp?rev=80491&r1=80490&r2=80491&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp Sun Aug 30 02:09:50 2009
@@ -310,9 +310,12 @@
   unsigned DiagID;
   if (SD)
     DiagID = diag::err_expected_class_or_namespace;
-  else if (SS.isSet())
-    DiagID = diag::err_typecheck_no_member_deprecated;
-  else
+  else if (SS.isSet()) {
+    DiagnoseMissingMember(IdLoc, DeclarationName(&II), 
+                          (NestedNameSpecifier *)SS.getScopeRep(), 
+                          SS.getRange());
+    return 0;
+  } else
     DiagID = diag::err_undeclared_var_use;
 
   if (SS.isSet())

Modified: cfe/trunk/test/SemaCXX/missing-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/missing-members.cpp?rev=80491&r1=80490&r2=80491&view=diff

==============================================================================
--- cfe/trunk/test/SemaCXX/missing-members.cpp (original)
+++ cfe/trunk/test/SemaCXX/missing-members.cpp Sun Aug 30 02:09:50 2009
@@ -13,6 +13,16 @@
   ::i; // expected-error {{no member named 'i' in the global namespace}}
 }
 
+namespace B {
+  class B { };
+}
+
+void g() {
+  A::B::D::E; // expected-error {{no member named 'D' in namespace 'A::B'}}
+  B::B::C::D; // expected-error {{no member named 'C' in class 'B::B'}}
+  ::C::D; // expected-error {{no member named 'C' in the global namespace}}
+}
+
 int A::B::i = 10; // expected-error {{no member named 'i' in namespace 'A::B'}}
 int A::B::C::i = 10; // expected-error {{no member named 'i' in class 'A::B::C'}}
 int A::B::S::i = 10; // expected-error {{no member named 'i' in struct 'A::B::S'}}





More information about the cfe-commits mailing list