
Consider range of value-initialized iterators as valid and empty. libstdc++-v3/ChangeLog: PR libstdc++/114316 * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_valid_range): First check if both iterators are value-initialized before checking if singular. * testsuite/23_containers/set/debug/114316.cc: New test case. * testsuite/23_containers/vector/debug/114316.cc: New test case.
16 lines
257 B
C++
16 lines
257 B
C++
// { dg-do run { target c++11 } }
|
|
// { dg-require-debug-mode "" }
|
|
|
|
// PR libstdc++/114316
|
|
|
|
#include <set>
|
|
#include <algorithm>
|
|
|
|
#include <testsuite_hooks.h>
|
|
|
|
int main()
|
|
{
|
|
std::set<int>::iterator it{};
|
|
VERIFY( std::find(it, it, 0) == it );
|
|
return 0;
|
|
}
|