summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-07 02:48:43 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-07 02:48:43 +0000
commit8d973111a832891e2fac54d793f68cc1b328cd8a (patch)
tree4d41fbf97feba6adc0c9faf46f59d9ac513f4c84 /clang/lib
parentf6768bd9cb07f56690f34cf973637cda4d3197f4 (diff)
downloadbcm5719-llvm-8d973111a832891e2fac54d793f68cc1b328cd8a.tar.gz
bcm5719-llvm-8d973111a832891e2fac54d793f68cc1b328cd8a.zip
When determining whether a variable is a file-scoped variable, check
out its lookup context (to see through linkage specifications). Addresses <rdar://problem/6477142>. llvm-svn: 61848
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclBase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index cf612c2f3c7..f14dc3c7175 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -567,8 +567,8 @@ DeclContext::lookup(ASTContext &Context, DeclarationName Name) const {
return const_cast<DeclContext*>(this)->lookup(Context, Name);
}
-DeclContext *DeclContext::getLookupContext() {
- DeclContext *Ctx = this;
+const DeclContext *DeclContext::getLookupContext() const {
+ const DeclContext *Ctx = this;
while (Ctx->isTransparentContext())
Ctx = Ctx->getParent();
return Ctx;
OpenPOWER on IntegriCloud