================
@@ -20643,10 +20641,12 @@ Sema::ConditionResult Sema::ActOnCondition(Scope *S,
SourceLocation Loc,
{SubExpr}, PreferredConditionType(CK));
if (!Cond.get())
return ConditionError();
- }
- if (!isa<FullExpr>(Cond.get()))
+ } else if (Cond.isUsable() && !isa<FullExpr>(Cond.get()))
Cond = ActOnFinishFullExpr(Cond.get(), Loc, /*DiscardedValue*/ false);
+ if (Cond.isInvalid())
----------------
erichkeane wrote:
```suggestion
if (!Cond.isUsable())
```
Unless there is a reason that `ConditionResult` would be ok with a 'null' expr?
https://github.com/llvm/llvm-project/pull/146890
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits