diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 01225feab..143c99769 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -887,6 +887,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); @@ -989,7 +990,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { - (void)this; // suppress clang warning + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 80172708a..ea3ceb457 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -129,6 +129,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); @@ -145,6 +146,7 @@ namespace Opm auto zeroElem = [this]() { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return 0.0; } else { return Value{this->primary_variables_.numWellEq() + Indices::numEq, 0.0}; @@ -579,7 +581,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { - (void)this; // suppress clang warning + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value);