From: Jonathan Wakely Date: Mon, 24 Mar 2025 21:36:16 +0000 (+0000) Subject: libstdc++: Add testcases for resolved bug [PR101527] X-Git-Tag: releases/gcc-14.3.0~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da6cea6625be011eeda958b096cf35573d2ab7bb;p=thirdparty%2Fgcc.git 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. (cherry picked from commit f7c0b0fc4fdeaf034dc38356830625f7280d325d) --- diff --git a/libstdc++-v3/testsuite/24_iterators/common_iterator/101527.cc b/libstdc++-v3/testsuite/24_iterators/common_iterator/101527.cc new file mode 100644 index 000000000000..0a2a5e8dfcca --- /dev/null +++ b/libstdc++-v3/testsuite/24_iterators/common_iterator/101527.cc @@ -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 + +bool test_pr101527() +{ + std::common_iterator it1; + std::common_iterator it2; + return it1 == it2; +} diff --git a/libstdc++-v3/testsuite/24_iterators/counted_iterator/101527.cc b/libstdc++-v3/testsuite/24_iterators/counted_iterator/101527.cc new file mode 100644 index 000000000000..51c6e99cd77c --- /dev/null +++ b/libstdc++-v3/testsuite/24_iterators/counted_iterator/101527.cc @@ -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 + +bool test_pr101527() +{ + std::counted_iterator it1; + std::counted_iterator it2; + return it1 == it2; +}