[cfe-commits] r80835 - in /cfe/trunk: include/clang/AST/Decl.h test/CodeGenCXX/static-data-member.cpp
Anders Carlsson
andersca at mac.com
Wed Sep 2 14:01:22 PDT 2009
Author: andersca
Date: Wed Sep 2 16:01:21 2009
New Revision: 80835
URL: http://llvm.org/viewvc/llvm-project?rev=80835&view=rev
Log:
Fix a crash when referencing static data members.
Added:
cfe/trunk/test/CodeGenCXX/static-data-member.cpp
Modified:
cfe/trunk/include/clang/AST/Decl.h
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=80835&r1=80834&r2=80835&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Wed Sep 2 16:01:21 2009
@@ -542,7 +542,7 @@
if (isa<TranslationUnitDecl>(Ctx) || isa<NamespaceDecl>(Ctx) )
return true;
}
- if (isStaticDataMember() && isOutOfLine())
+ if (isStaticDataMember())
return true;
return false;
Added: cfe/trunk/test/CodeGenCXX/static-data-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-data-member.cpp?rev=80835&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/static-data-member.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/static-data-member.cpp Wed Sep 2 16:01:21 2009
@@ -0,0 +1,8 @@
+// RUN: clang-cc -emit-llvm -o - %s
+struct S {
+ static int i;
+};
+
+void f() {
+ int a = S::i;
+}
More information about the cfe-commits
mailing list