Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clang crashes when parsing operator== for an enum parameter with a bool enum base and no enumerator list #56560

Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]
@alanzhao1

Description

@alanzhao1

llvm commit I have checked out where this is broken (not necessarily the cause):4a40fa8

Repro steps

test.cpp:

enum Foo :bool;boolbar(Foo a, Foo b) {return a == b;}
  1. Build Clang withLLVM_ENABLE_ASSERTIONS:BOOL=ON
  2. Runclang++ -c test.cpp -o test

Expected result:
clang should compile the file

Actual result:

clang crashes with the assertion

clang++: /path/to/llvm/repo/llvm-project/clang/lib/AST/Expr.cpp:1836: bool clang::CastExpr::CastConsistency() const: Assertion `!getType()->isBooleanType() && "unheralded conversion to bool"' failed.

The full stacktrace is in the attached stacktrace.txt.

(I had to change the extension of the.cpp file and the.sh file as GitHub doesn't support those file type extensions as attachments)

stacktrace.txt
test-f893c2.cpp.txt
test-f893c2.sh.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp