diff options
-rw-r--r-- | include/clang/AST/Decl.h | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/static-data-member.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index e8c29987b0..0fb7fc478d 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -542,7 +542,7 @@ public: if (isa<TranslationUnitDecl>(Ctx) || isa<NamespaceDecl>(Ctx) ) return true; } - if (isStaticDataMember() && isOutOfLine()) + if (isStaticDataMember()) return true; return false; diff --git a/test/CodeGenCXX/static-data-member.cpp b/test/CodeGenCXX/static-data-member.cpp new file mode 100644 index 0000000000..6e2abcc1ad --- /dev/null +++ b/test/CodeGenCXX/static-data-member.cpp @@ -0,0 +1,8 @@ +// RUN: clang-cc -emit-llvm -o - %s +struct S { + static int i; +}; + +void f() { + int a = S::i; +} |