From: François Dumont Date: Wed, 31 Jul 2024 20:25:20 +0000 (+0200) Subject: libstdc++: Fix unexpected compilation error in neg tests X-Git-Tag: basepoints/gcc-16~7092 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=787f2d52d595e316d24f2baadf114bb8a4d8c70f;p=thirdparty%2Fgcc.git libstdc++: Fix unexpected compilation error in neg tests Fix a compilation error that is not expected by the tests preserving the expected ones. The 'test' variable declaration is missing since commit a9260b7eb688df43a724e25421ba40f35a89fee9 that removed the test global variable in testsuite files. libstdc++-v3/ChangeLog: * testsuite/23_containers/map/operators/1_neg.cc (test01): Add test variable declaration. * testsuite/23_containers/set/operators/1_neg.cc (test01): Likewise. --- diff --git a/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc b/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc index 1cb089306906..0eb1eee640b8 100644 --- a/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc @@ -28,14 +28,13 @@ void test01() { std::map mapByIndex; std::map mapByName; - + mapByIndex.insert(std::pair(0, 1)); mapByIndex.insert(std::pair(6, 5)); - + std::map::iterator itr(mapByIndex.begin()); // NB: notice, it's not mapByIndex!! - test &= itr != mapByName.end(); // { dg-error "no" } - test &= itr == mapByName.end(); // { dg-error "no" } + bool __attribute__((unused)) test = itr != mapByName.end(); // { dg-error "no" } + test &= itr == mapByName.end(); // { dg-error "no" } } - diff --git a/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc b/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc index be90ba51cd4e..28d08f308e17 100644 --- a/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc @@ -28,11 +28,10 @@ void test01() { std::set setByIndex; std::set setByName; - + std::set::iterator itr(setByIndex.begin()); - + // NB: it's not setByIndex!! - test &= itr != setByName.end(); // { dg-error "no" } - test &= itr == setByName.end(); // { dg-error "no" } + bool __attribute__((unused)) test = itr != setByName.end(); // { dg-error "no" } + test &= itr == setByName.end(); // { dg-error "no" } } -