Skip to content

Commit

Permalink
libstdc++: Make dg-error pattern more accurate
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jwakely authored and Dums35 committed Aug 1, 2024
1 parent 295b729 commit 0d514c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
4 changes: 2 additions & 2 deletions libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}

0 comments on commit 0d514c1

Please sign in to comment.