[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)
Michele Scandale via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 16 14:54:31 PDT 2025
================
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const {
inline bool Type::isBooleanType() const {
if (const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
return BT->getKind() == BuiltinType::Bool;
+ if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
----------------
michele-scandale wrote:
This is to match `isIntegerType` that is used by `hasIntegerRepresentation`.
I'm not entirely sure it makes sense to handle enums here (given also the FIXME comment).
I'll try to see what breaks by removing this.
https://github.com/llvm/llvm-project/pull/136038
More information about the cfe-commits
mailing list