]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Make dg-error pattern more accurate
authorJonathan Wakely <jwakely@redhat.com>
Thu, 1 Aug 2024 04:53:03 +0000 (06:53 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Thu, 1 Aug 2024 16:52:55 +0000 (18:52 +0200)
Remove useless test variable and use a more accurate dg-error pattern so
that only the ill-formed expression compilation error is considered.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/map/operators/1_neg.cc (test01): Remove test variable
and use 'no match' dg-error patter.
* testsuite/23_containers/set/operators/1_neg.cc (test01): Likewise.

libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc
libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc

index 0eb1eee640b838e7a557051419da5e423b5831f3..6ce7b3249d8cbb8625497012d21fa9fb4a3f6b2b 100644 (file)
@@ -35,6 +35,6 @@ void test01()
   std::map<unsigned, int>::iterator itr(mapByIndex.begin());
 
   // NB: notice, it's not mapByIndex!!
-  bool __attribute__((unused)) test = itr != mapByName.end(); // { dg-error "no" }
-  test &= itr == mapByName.end(); // { dg-error "no" }
+  itr != mapByName.end(); // { dg-error "no match" }
+  itr == mapByName.end(); // { dg-error "no match" }
 }
index 28d08f308e17b2263af4c74f822ea2a93e9dc1cf..b5f69ae920c244b1f543a5178fc7cdf997d37020 100644 (file)
@@ -32,6 +32,6 @@ void test01()
   std::set<unsigned int>::iterator itr(setByIndex.begin());
 
   // NB: it's not setByIndex!!
-  bool __attribute__((unused)) test = itr != setByName.end(); // { dg-error "no" }
-  test &= itr == setByName.end(); // { dg-error "no" }
+  itr != setByName.end(); // { dg-error "no match" }
+  itr == setByName.end(); // { dg-error "no match" }
 }