Skip to content

Commit dc1b011

Browse files
committed
Changed VarDecl::hasGlobalStorage() to be the negation of hasLocalStorage().
Before it was the negation of hasAutoStorage(), which is incorrect. "Register" storage for Decls do not indicate global variables. llvm-svn: 47630
1 parent d7a258d commit dc1b011

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class VarDecl : public ValueDecl {
329329
/// hasGlobalStorage - Returns true for all variables that do not
330330
/// have local storage. This includs all global variables as well
331331
/// as static variables declared within a function.
332-
bool hasGlobalStorage() const { return !hasAutoStorage(); }
332+
bool hasGlobalStorage() const { return !hasLocalStorage(); }
333333

334334
// Implement isa/cast/dyncast/etc.
335335
static bool classof(const Decl *D) {

0 commit comments

Comments
 (0)