File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -459,11 +459,11 @@ static void InstantiateDeclareReduction(OmpDirectiveSpecification &spec) {
459459
460460 const OmpTypeNameList *typeNames{nullptr};
461461
462- if (auto *cexpr{GetCombinerExpr(*rspec)}) {
462+ if (auto *cexpr{
463+ const_cast<OmpCombinerExpression *>(GetCombinerExpr(*rspec))}) {
463464 typeNames = &std::get<OmpTypeNameList>(rspec->t);
464465
465- InstantiateForTypes(const_cast<OmpCombinerExpression &>(*cexpr), *typeNames,
466- OmpCombinerExpression::Variables());
466+ InstantiateForTypes(*cexpr, *typeNames, OmpCombinerExpression::Variables());
467467 delete cexpr->state;
468468 cexpr->state = nullptr;
469469 } else {
@@ -474,9 +474,10 @@ static void InstantiateDeclareReduction(OmpDirectiveSpecification &spec) {
474474 for (const OmpClause &clause : spec.Clauses().v) {
475475 llvm::omp::Clause id{clause.Id()};
476476 if (id == llvm::omp::Clause::OMPC_initializer) {
477- if (auto *iexpr{GetInitializerExpr(clause)}) {
478- InstantiateForTypes(const_cast<OmpInitializerExpression &>(*iexpr),
479- *typeNames, OmpInitializerExpression::Variables());
477+ if (auto *iexpr{const_cast<OmpInitializerExpression *>(
478+ GetInitializerExpr(clause))}) {
479+ InstantiateForTypes(
480+ *iexpr, *typeNames, OmpInitializerExpression::Variables());
480481 delete iexpr->state;
481482 iexpr->state = nullptr;
482483 }
You can’t perform that action at this time.
0 commit comments