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())
::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'}}