suppress unused lambda capture warnings with clang

This commit is contained in:
Arne Morten Kvarving 2023-06-27 13:41:12 +02:00
parent adfe80cba0
commit fffb3d9f0e
2 changed files with 5 additions and 2 deletions

View File

@ -887,6 +887,7 @@ namespace Opm
auto obtain = [this](const Eval& value)
{
if constexpr (std::is_same_v<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
(void)this; // suppress clang warning
static_cast<void>(this); // suppress clang warning
return getValue(value);
} else {
return this->extendEval(value);

View File

@ -129,6 +129,7 @@ namespace Opm
auto obtain = [this](const Eval& value)
{
if constexpr (std::is_same_v<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
(void)this; // suppress clang warning
static_cast<void>(this); // suppress clang warning
return getValue(value);
} else {
return this->extendEval(value);