http://llvm.org/bugs/show_bug.cgi?id=2971
Summary: &((char*)0)[0] not regarded as static initializer
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: LLVM Codegen
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
The following code crashes clang:
typedef struct FuncDef FuncDef;
struct FuncDef {};
void sqlite3RegisterDateTimeFunctions(void){
static FuncDef aDateTimeFuncs = {((void*)&((char*)0)[0])};
}
With the error message:
clang: CGDecl.cpp:86: llvm::GlobalValue*
clang::CodeGen::CodeGenFunction::GenerateStaticBlockVarDecl(const
clang::VarDecl&, bool, const char*): Assertion
`getContext().getLangOptions().CPlusPlus && "only C++ supports non-constant
static initializers!"' failed.
(I'm not sure if this a duplicate or not. I have the strange feeling it's not
the first time I'm seeing this bug..)
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs