diff options
author | François Dumont <frs.dumont@gmail.com> | 2024-07-31 22:25:20 +0200 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2024-07-31 22:39:15 +0200 |
commit | 787f2d52d595e316d24f2baadf114bb8a4d8c70f (patch) | |
tree | 64635214585ffaf33fa6d7614dcdaa0e071190d6 | |
parent | e7d88ff8aaa244f3f722fc1dc50e8dc31d5c8fde (diff) | |
download | gcc-787f2d52d595e316d24f2baadf114bb8a4d8c70f.zip gcc-787f2d52d595e316d24f2baadf114bb8a4d8c70f.tar.gz gcc-787f2d52d595e316d24f2baadf114bb8a4d8c70f.tar.bz2 |
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.
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc | 9 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc | 9 |
2 files changed, 8 insertions, 10 deletions
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 1cb0893..0eb1eee 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<unsigned int, int> mapByIndex; std::map<std::string, unsigned> mapByName; - + mapByIndex.insert(std::pair<unsigned, int>(0, 1)); mapByIndex.insert(std::pair<unsigned, int>(6, 5)); - + std::map<unsigned, int>::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 be90ba5..28d08f3 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<unsigned int> setByIndex; std::set<std::string> setByName; - + std::set<unsigned int>::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" } } - |