================
@@ -17463,27 +17488,31 @@
SemaOpenMP::ActOnOpenMPFlattenDirective(ArrayRef<OMPClause *> Clauses,
if (!TripCount.isUsable())
return StmtError();
- auto MakeNumIterationsInIVTy = [&](unsigned I) -> Expr * {
- return AssertSuccess(SemaRef.PerformImplicitConversion(
- MakeNumIterations(I), IVTy, AssignmentAction::Converting,
- /*AllowExplicit=*/true));
+ auto MakeNumIterationsInIVTy = [&](unsigned I) -> ExprResult {
+ ExprResult N = MakeNumIterations(I);
+ if (!N.isUsable())
+ return ExprError();
+ return SemaRef.PerformImplicitConversion(
+ N.get(), IVTy, AssignmentAction::Converting, /*AllowExplicit=*/true);
----------------
loopacino wrote:
If `PerformImplicitConversion` fails, the old code would get a null expr and
keep going. The new code returns `ExprResult` and returns an error if
conversion fails (same as kept with `buildNumIterations`). So keeping
`AssertSuccess` here would be less safe than more. This is dropped on-purpose.
Happy to add a comment if that helps.
https://github.com/llvm/llvm-project/pull/229458
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits