]> granicus.if.org Git - clang/commitdiff
Changed VarDecl::hasGlobalStorage() to be the negation of hasLocalStorage().
authorTed Kremenek <kremenek@apple.com>
Tue, 26 Feb 2008 21:57:11 +0000 (21:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 26 Feb 2008 21:57:11 +0000 (21:57 +0000)
Before it was the negation of hasAutoStorage(), which is incorrect.
"Register" storage for Decls do not indicate global variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47630 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h

index 82b8cacf95a6064fbc5902dcedc7237ef6d1ee18..7f7e3afa399fcb2e6f8838115b7b92e96f84e641 100644 (file)
@@ -329,7 +329,7 @@ public:
   /// hasGlobalStorage - Returns true for all variables that do not
   ///  have local storage.  This includs all global variables as well
   ///  as static variables declared within a function.
-  bool hasGlobalStorage() const { return !hasAutoStorage(); }
+  bool hasGlobalStorage() const { return !hasLocalStorage(); }
   
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {