More missing member goodness.

llvm-svn: 80491
This commit is contained in:
Anders Carlsson 2009-08-30 07:09:50 +00:00
parent 03686805e8
commit b533df02b5
2 changed files with 16 additions and 3 deletions

View File

@ -310,9 +310,12 @@ Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S,
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())

View File

@ -13,6 +13,16 @@ void f() {
::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'}}