diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-08 15:38:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-08 15:38:36 +0000 |
commit | a64c1e5452dea9d227276c21e5457ccd30a202c1 (patch) | |
tree | 98e3f70601b680795c005d0484e994fdf1370e3b /clang/lib/Sema/SemaLookup.cpp | |
parent | 24c0bb1ca1e9476cc98d79fb7ce06ca6710b63e6 (diff) | |
download | bcm5719-llvm-a64c1e5452dea9d227276c21e5457ccd30a202c1.tar.gz bcm5719-llvm-a64c1e5452dea9d227276c21e5457ccd30a202c1.zip |
When performing unqualified name lookup in C++, don't look directly
into transparent contexts; instead, we'll look into their nearest
enclosing non-transparent contexts further up the stack. Fixes PR5479.
llvm-svn: 90859
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 1ddfef839fd..48d7320d2e9 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -480,7 +480,12 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) { DeclContext *OuterCtx = findOuterContext(S); for (; Ctx && Ctx->getPrimaryContext() != OuterCtx; Ctx = Ctx->getLookupParent()) { - if (Ctx->isFunctionOrMethod()) + // We do not directly look into function or method contexts + // (since all local variables are found via the identifier + // changes) or in transparent contexts (since those entities + // will be found in the nearest enclosing non-transparent + // context). + if (Ctx->isFunctionOrMethod() || Ctx->isTransparentContext()) continue; // Perform qualified name lookup into this context. |