-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 3730 |
| Resolution | WORKSFORME |
| Resolved on | Apr 24, 2011 13:42 |
| Version | unspecified |
| OS | Linux |
Extended Description
Testcase:
enum y b(void);
struct x {enum y (*test)(void);} z = {b};
enum y {AAA,BBB};
int a() { return z.test(); }
cc1: Instructions.cpp:2164: static llvm::Instruction::CastOps llvm::CastInst::getCastOpcode(const llvm::Value*, bool, const llvm::Type*, bool): Assertion `SrcTy->isFirstClassType() && DestTy->isFirstClassType() && "Only first class types are castable!"' failed.
: In function ‘a’:
:4: internal compiler error: Aborted
Another similar testcase:
enum y b(void);
struct x {enum y (*test)(void);} z = {b};
enum y {AAA,BBB};
enum y b(void) { return BBB; }
cc1: Function.cpp:164: llvm::Function::Function(const llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, const std::string&, llvm::Module*): Assertion `FunctionType::isValidReturnType(getReturnType()) && !isa(getReturnType()) && "invalid return type"' failed.
: In function ‘b’:
:4: internal compiler error: Aborted
These are contrived testcases I came up with while comparing the output of llvm-gcc and clang for incomplete function types, so probably not a serious issue, but it might be worth looking at.