aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
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
commit17a9b9e3ee75f5dbb4819cc8ebf40eec8015f84a (patch)
treef9563f0b64d98952b69ecc122350c3c00b62e4db /lib/AST/DeclBase.cpp
parentefb4aebfb01b1b6830bb7a926cb474a1631a1f27 (diff)
When determining whether a variable is a file-scoped variable, check
out its lookup context (to see through linkage specifications). Addresses <rdar://problem/6477142>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index cf612c2f3c..f14dc3c717 100644
--- a/lib/AST/DeclBase.cpp
+++ b/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;