aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-05-15 17:53:43 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-05-15 17:53:43 +0000
commit1bf7dd75706a67de2368226b2d2c590c23d7dbf5 (patch)
tree0db130a02295691bbf96fd615aeb8522100f8cf3
parent3d0d83a4a0694c1bf4509c893162f0cdf454ee14 (diff)
Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51153 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Decl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 191baabe27..f346be80ea 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -274,7 +274,8 @@ public:
bool isFileVarDecl() const {
if (getKind() != Decl::Var)
return false;
- if (isa<TranslationUnitDecl>(getDeclContext()))
+ if (isa<TranslationUnitDecl>(getDeclContext()) ||
+ isa<NamespaceDecl>(getDeclContext()) )
return true;
return false;
}