diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 56cf5d4fd37..cc2a11fccfb 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -14394,7 +14394,12 @@ Sema::ConditionResult Sema::ActOnCondition(Scope *S, SourceLocation Loc, if (Cond.isInvalid()) return ConditionError(); - return ConditionResult(*this, nullptr, MakeFullExpr(Cond.get(), Loc), + // FIXME: FullExprArg doesn't have an invalid bit, so check nullness instead. + FullExprArg FullExpr = MakeFullExpr(Cond.get(), Loc); + if (!FullExpr.get()) + return ConditionError(); + + return ConditionResult(*this, nullptr, FullExpr, CK == ConditionKind::ConstexprIf); } |