diff options
| author | Leitwolf11 | 2026-10-31 13:36:43 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-10-31 13:36:43 +0300 |
| commit | afe91797e9d50cd4712d3694a2e5fedfc0b966b1 (patch) | |
| tree | 5cec698f0bc0b8a60f45e866fb40f2fd8a358bd1 /src/Progmasoft | |
| parent | 653dde1cc5a2f17faec2ed25f904de9c3cf3c8fa (diff) | |
| download | catch3-build/cpp17.tar.gz | |
Finish the move to C++17 in POSIX code and the amalgamated filesbuild/cpp17
A lambda in the POSIX half of Process.cpp captured a structured binding,
which needs C++20 and which a Windows build never compiles. The files in
extras still held the C++20 sources, so they are generated again, and the
generator no longer says the runner needs C++20.
Diffstat (limited to 'src/Progmasoft')
| -rw-r--r-- | src/Progmasoft/Runner/Process.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Progmasoft/Runner/Process.cpp b/src/Progmasoft/Runner/Process.cpp index d0b5b512..585822f3 100644 --- a/src/Progmasoft/Runner/Process.cpp +++ b/src/Progmasoft/Runner/Process.cpp @@ -961,13 +961,15 @@ namespace Progmasoft::Catch3::Runner } for (const auto &[name, value] : options.environment) { + // A lambda cannot capture a structured binding in C++17. + const std::string &variable = name; const auto removed = std::remove_if( environmentStorage.begin(), environmentStorage.end(), [&](const std::string &entry) { - return entry.size() > name.size() - && entry.compare(0, name.size(), name) == 0 - && entry[name.size()] == '='; + return entry.size() > variable.size() + && entry.compare(0, variable.size(), variable) == 0 + && entry[variable.size()] == '='; }); environmentStorage.erase(removed, environmentStorage.end()); environmentStorage.push_back(name + "=" + value); |