[clang] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 07:13:07 PDT 2025


================
@@ -20629,6 +20629,9 @@ Sema::ConditionResult Sema::ActOnCondition(Scope *S, SourceLocation Loc,
 
   case ConditionKind::ConstexprIf:
     Cond = CheckBooleanCondition(Loc, SubExpr, true);
+    assert(isa<FullExpr>(Cond.get()) &&
----------------
erichkeane wrote:

`Cond` could still be invalid here, right?  so `.get` would be ill-formed?  Should we be doing some sort of `if (Cond.isUsable())` or something? 

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


More information about the cfe-commits mailing list