[clang] [clang] Allow fixed-point to bool enumeration conversions (PR #245853)
Sendao Yan via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 24 19:22:53 PST 2026
================
@@ -3051,7 +3051,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
case CK_FixedPointToBoolean:
assert(E->getType()->isFixedPointType() &&
"Expected src type to be fixed point type");
- assert(DestTy->isBooleanType() && "Expected dest type to be boolean type");
+ assert((DestTy->isBooleanType() || hasBoolConversionSemantics(DestTy)) &&
----------------
sendaoYan wrote:
Done, thanks — `hasBoolConversionSemantics()` already falls back to `isBooleanType()`, so the extra check was redundant.
https://github.com/llvm/llvm-project/pull/245853
More information about the cfe-commits
mailing list