Spell the mode loop initializers as std::string

Two range-for loops bound const std::string& to braced lists of string
literals, so each iteration constructed a temporary to bind to. GCC 16
reports it as -Wrange-loop-construct, which upstream's blanket -Werror turns
into a build failure; clang does not report it at all. Spell the
initializers the way the loop above them already does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-09-18 01:32:26 -04:00
co-authored by Claude Opus 5
parent 98544fd6bc
commit f7a08b0868
+2 -2
View File
@@ -1423,7 +1423,7 @@ TEST_CASE("imex_resolve_routing - warning and block can never disagree about the
const std::vector<std::vector<int>> slot_sets = { {}, {1}, {2}, {3}, {1, 2}, {2, 3}, {4} };
const std::vector<ConfigOptionInts> pems = { make_pem({0, 1}), make_pem({0, 0, 1, 2}), make_pem({1, 0}) };
for (const std::string& mode : { "copy", "quad" }) {
for (const std::string& mode : { std::string("copy"), std::string("quad") }) {
for (size_t s = 0; s < slot_sets.size(); ++s) {
for (size_t p = 0; p < pems.size(); ++p) {
DYNAMIC_SECTION(mode << " slots#" << s << " pem#" << p) {
@@ -1473,7 +1473,7 @@ TEST_CASE("imex_resolve_routing - an unresolved or ragged mode yields an empty r
{ "", "S", "R" });
const auto pem = make_pem({0, 1});
for (const std::string& mode : { "copy-renamed", "ragged" }) {
for (const std::string& mode : { std::string("copy-renamed"), std::string("ragged") }) {
DYNAMIC_SECTION("mode " << mode) {
const ImexRouting r = imex_resolve_routing(cfg, mode, { 2 }, pem);
CHECK(r.parallel);