forked from OSchip/llvm-project
parent
03686805e8
commit
b533df02b5
|
@ -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())
|
||||
|
|
|
@ -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'}}
|
||||
|
|
Loading…
Reference in New Issue