Skip to content

Clang crashes with broken program containing _Complex int and fixed-point literal #51210

Open
@dstenb

Description

@dstenb
Bugzilla Link 51868
Version trunk
OS Linux
CC @zygoloid

Extended Description

Commit: d261d4c

Compiling the following broken program:

f() { for (_Complex int a_1 0.5r / a_2

with:

$ clang -ffixed-point foo.c

gives:

foo.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
f() { for (_Complex int a_1 0.5r / a_2
^
foo.c:1:29: error: expected ';' in 'for' statement specifier
f() { for (_Complex int a_1 0.5r / a_2
                            ^
getIntegerRank(): not a built-in integer
UNREACHABLE executed at /clang/lib/AST/ASTContext.cpp:6402!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.

If e.g. switching to a floating-point literal the crash is not seen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions