libstdc++: Add testcases for resolved bug [PR101527]

These tests were fixed by a front-end change r13-465-g4df735e01e3199 so
this just adds them to the testsuite to be sure we don't regress.

libstdc++-v3/ChangeLog:

	PR libstdc++/101527
	* testsuite/24_iterators/common_iterator/101527.cc: New test.
	* testsuite/24_iterators/counted_iterator/101527.cc: New test.
This commit is contained in:
Jonathan Wakely 2025-03-24 21:36:16 +00:00 committed by Jonathan Wakely
parent 14c924333d
commit f7c0b0fc4f
No known key found for this signature in database
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,14 @@
// { dg-do compile { target c++20 } }
// PR libstdc++/101527
// implementation of std::common_iterator and std::counted_iterator's
// operator== seems to be wrong
#include <iterator>
bool test_pr101527()
{
std::common_iterator<int*, std::unreachable_sentinel_t> it1;
std::common_iterator<const int*, std::unreachable_sentinel_t> it2;
return it1 == it2;
}

View file

@ -0,0 +1,14 @@
// { dg-do compile { target c++20 } }
// PR libstdc++/101527
// implementation of std::common_iterator and std::counted_iterator's
// operator== seems to be wrong
#include <iterator>
bool test_pr101527()
{
std::counted_iterator<int*> it1;
std::counted_iterator<const int*> it2;
return it1 == it2;
}