Skip to content

llvm-gcc crash with incomplete enum type #4102

@efriedma-quic

Description

@efriedma-quic
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaworksformeResolved as "works for me"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions