When casting an enumerate with a fixed bool type the casting should use an IntegralToBoolean instead of an IntegralCast.
Fixes PR47055: Incorrect codegen for enum with bool underlying type
Paths
| Differential D85612
[Sema] Use proper integral cast for an enumerate with a fixed bool type ClosedPublic Authored by Mordante on Aug 9 2020, 9:19 AM.
Details Summary When casting an enumerate with a fixed bool type the casting should use an IntegralToBoolean instead of an IntegralCast. Fixes PR47055: Incorrect codegen for enum with bool underlying type
Diff Detail Event Timelinericcibruno added inline comments.
Mordante added inline comments.
Mordante added inline comments.
This revision is now accepted and ready to land.Aug 15 2020, 7:03 AM Closed by commit rGfef260712407: [Sema] Use the proper cast for a fixed bool enum. (authored by Mordante). · Explain WhyAug 16 2020, 9:44 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 284216 clang/lib/Sema/SemaCast.cpp
clang/test/AST/ast-dump-enum-bool.cpp
|
Why a (pretty unreadable) json test? There is also make-ast-dump-check.sh to auto-generate an ast dump test.