git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80491 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2009-08-30 07:09:50 +00:00
Родитель 639bfc7b1e
Коммит a31d5f70e0
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -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'}}