Closed kripken closed 13 years ago
This is fixed in top-of-tree.
Here's a reduced testcase:
struct usvec { int x; };
struct shaftbb { union { int v[2]; struct { usvec min, max; }; };
shaftbb(); };
shaftbb::shaftbb() {}
Clang is dying trying to get an lvalue to min to initialize it. This is probably a trivial bug (just insert a bitcast somewhere), but it's not clear to me why we're trying to do any initialization in the constructor in this case at all.
Extended Description
The following code fails to compile with clang:
======
include "stdio.h"
struct usvec { int x; };
struct shaftbb { union { int v[2]; struct { usvec min, max; }; };
shaftbb() {} };
int main() { shaftbb s; return 1; }
The error is
====== clang: /home/alon/Dev/llvm-svn/include/llvm/Instructions.h:278: const llvm::Type llvm::checkType(const llvm::Type): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed. 0 clang 0x095746a8 Stack dump:
llvm1.cpp:16:3: Generating code for declaration 'shaftbb::shaftbb' clang: error: unable to execute command: Aborted clang: error: clang frontend command failed due to signal 1 (use -v to see invocation)
The file compiles ok with gcc.
This is a reduced testcase from pvs.cpp from Sauerbraten (open source FPS) which I am trying to compile with clang.