[cfe-dev] Function pointers in structs in arrays codegen assert

Keith Bauer onesadcookie at gmail.com
Mon Dec 10 18:51:15 PST 2007

It's fine for function pointers in global arrays, and function
pointers in global structs, just not the combination...

typedef void (* F)(void);
extern void foo(void);
struct S { F f; };
struct S a[1] = { { foo } };

CookieJar:Desktop keith$ clang -emit-llvm fptrinit.c
Assertion failed: (ILE->getType()->isArrayType() ||
ILE->getType()->isStructureType()), function GenerateAggregateInit,
file CodeGenModule.cpp, line 283.


More information about the cfe-dev mailing list