From 9dd54fb11a9e61e31e1574bb04d408042b46f3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 30 Aug 2024 11:44:29 +0200 Subject: [PATCH] Avoid capturing structured bindings. This is an error before C++20, and clang refuses it. --- opm/simulators/flow/BlackoilModel.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/flow/BlackoilModel.hpp b/opm/simulators/flow/BlackoilModel.hpp index 588c6e240..3d602a7fe 100644 --- a/opm/simulators/flow/BlackoilModel.hpp +++ b/opm/simulators/flow/BlackoilModel.hpp @@ -975,14 +975,14 @@ namespace Opm { // semicolon. This is an immediately invoked function // expression which calculates a single boolean value. const auto relax_pv_fraction_cnv = - [&report, pvSum, numAquiferPvSum, this]() + [&report, this, eligible = pvSum - numAquiferPvSum]() { const auto& cnvPvSplit = report.cnvPvSplit().first; // [1]: tol < cnv <= relaxed // [2]: relaxed < cnv return static_cast(cnvPvSplit[1] + cnvPvSplit[2]) < - this->param_.relaxed_max_pv_fraction_ * (pvSum - numAquiferPvSum); + this->param_.relaxed_max_pv_fraction_ * eligible; }(); const bool use_relaxed_cnv = relax_final_iteration_cnv