From a85829572c2daa5a10275604bb46d0d63963d522 Mon Sep 17 00:00:00 2001 From: PucklaJ Date: Thu, 4 Apr 2024 13:02:25 +0200 Subject: [PATCH] Fix clang error concerning structured bindings --- test/key_test.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/key_test.cpp b/test/key_test.cpp index 9bb4411..36c18a2 100644 --- a/test/key_test.cpp +++ b/test/key_test.cpp @@ -966,10 +966,19 @@ TEST_CASE("none") { } { - auto [mid, ro, e, pr, sigy, etan, eppf, tdel] = + auto [_mid, _ro, _e, _pr, _sigy, _etan, _eppf, _tdel] = card.parse_whole(); + const auto mid = _mid; + const auto ro = _ro; + const auto e = _e; + const auto pr = _pr; + const auto sigy = _sigy; + const auto etan = _etan; + const auto eppf = _eppf; + const auto tdel = _tdel; + CHECK(mid == 1); CHECK(ro == 9.879e-6f); CHECK(e == 316.0f); @@ -983,7 +992,13 @@ TEST_CASE("none") { card = ks["MAT_PIECEWISE_LINEAR_PLASTICITY"][0][1]; { - auto [C, P, lcss, lcsr] = card.parse_whole(); + auto [_C, _P, _lcss, _lcsr] = + card.parse_whole(); + + const auto C = _C; + const auto P = _P; + const auto lcss = _lcss; + const auto lcsr = _lcsr; CHECK(C == 50); CHECK(P == 6); @@ -1012,9 +1027,14 @@ TEST_CASE("none") { } { - auto [C, P, lcss, lcsr] = + auto [_C, _P, _lcss, _lcsr] = card.parse_whole(); + const auto C = _C; + const auto P = _P; + const auto lcss = _lcss; + const auto lcsr = _lcsr; + CHECK(C == 50); CHECK(P == 6); CHECK(lcss == "");