[Sema] Use the proper cast for a fixed bool enum.
authorMark de Wever <koraq@xs4all.nl>
Sun, 16 Aug 2020 16:40:08 +0000 (18:40 +0200)
committerMark de Wever <koraq@xs4all.nl>
Sun, 16 Aug 2020 16:40:08 +0000 (18:40 +0200)
commitfef26071240711e8f7305715b5f22cfc7ad04bfe
tree193c6cd83d1aca0543df43ee33b2e6972d42755a
parent827ba67e383313b05e9b10c8215e501530d6c9e3
[Sema] Use the proper cast for a fixed bool enum.

When casting an enumerate with a fixed bool type the casting should use
an IntegralToBoolean instead of an IntegralCast as is required per Core
Issue 2338.

Fixes PR47055: Incorrect codegen for enum with bool underlying type

Differential Revision: https://reviews.llvm.org/D85612
clang/lib/Sema/SemaCast.cpp
clang/test/CXX/drs/dr23xx.cpp
clang/test/CodeGen/enum-bool.cpp [new file with mode: 0644]