]> granicus.if.org Git - clang/commitdiff
Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 15 May 2008 17:53:43 +0000 (17:53 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 15 May 2008 17:53:43 +0000 (17:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51153 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h

index 191baabe27f32917b36d4e715d5d437af21a7080..f346be80eadaa3f502ab7afbb839a5ba3a50d10d 100644 (file)
@@ -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;
   }