[clang] [clang] Allow fixed-point to bool enumeration conversions (PR #245853)

Shengxin Pei via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 19:13:59 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)) &&
----------------
TPPPP72 wrote:

https://github.com/llvm/llvm-project/blob/d245e2386da0fd4fcfee2e9d716a6aa2ed521b3b/clang/lib/CodeGen/CGExprScalar.cpp#L182-L186

We already have 'T->isBooleanType()' here.

https://github.com/llvm/llvm-project/pull/245853


More information about the cfe-commits mailing list