Skip to content
Snippets Groups Projects
Commit 5a14116e authored by Jö Fahlke's avatar Jö Fahlke
Browse files

SIMD test: fix implicit this capture warnings

C++20 deprecates implicit capture of `this` using `[=]`, and gcc9 warns about
that.  Unfortunately, in C++ before 20 listing `this` together with a
capture-default of `=` is illegal, and GCC 8 emits a warning about that that
apparently can't be silenced.  So the only option if we want to appease both
pre- and post-C++20 is to list each entity to be captures explicitly.
Luckily, that is not too hard in this case.

See https://gitlab.dune-project.org/core/dune-common/-/jobs/139584#L486
(debian:11 gcc-9-20):
```
[ 40%] Building CXX object dune/common/CMakeFiles/dunecommon.dir/simd/test.cc.o
In file included from /builds/core/dune-common/dune/common/simd/test.cc:6:
/builds/core/dune-common/dune/common/simd/test.hh: In lambda function:
/builds/core/dune-common/dune/common/simd/test.hh:334:36: warning: implicit capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
  334 |         Hybrid::forEach(Rebinds{}, [=](auto target) {
      |                                    ^
/builds/core/dune-common/dune/common/simd/test.hh:334:36: note: add explicit 'this' or '*this' capture
```
parent 504bd2d4
Branches
Tags
1 merge request!775SIMD test: fix implicit this capture warnings
Pipeline #24639 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment