Skip transparent contexts when performing C++ name lookup

llvm-svn: 79931
This commit is contained in:
Douglas Gregor 2009-08-24 18:55:03 +00:00
parent c327709db8
commit f2270430a1
2 changed files with 11 additions and 0 deletions

View File

@ -755,6 +755,9 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
for (; S; S = S->getParent()) {
DeclContext *Ctx = static_cast<DeclContext *>(S->getEntity());
if (Ctx->isTransparentContext())
continue;
assert(Ctx && Ctx->isFileContext() &&
"We should have been looking only at file context here already.");

View File

@ -25,3 +25,11 @@ extern "C" int const bar;
// <rdar://problem/6895431>
extern "C" struct bar d;
extern struct bar e;
extern "C++" {
namespace N0 {
struct X0 {
int foo(int x) { return x; }
};
}
}