Message ID | 20220912164531.1742034-1-ppalka@redhat.com |
---|---|
State | New |
Headers | show |
Series | [1/4] libstdc++: Add already-accepted <ranges> testcase [PR106320] | expand |
On Mon, 12 Sep 2022, 17:46 Patrick Palka via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > Although PR106320 only affected the 10 and 11 branches, and the testcase > from there was already correctly accepted on trunk and the 12 branch, we > should also add the testcase to 12/trunk for inter-branch consistency. > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/12? > Yes, good idea to add this. > PR libstdc++/106320 > > libstdc++-v3/ChangeLog: > > * testsuite/std/ranges/adaptors/join.cc (test13): New test. > --- > libstdc++-v3/testsuite/std/ranges/adaptors/join.cc | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc > b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc > index 8986f718229..530ab6663b5 100644 > --- a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc > +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc > @@ -205,6 +205,18 @@ test12() > }(); > } > > +void > +test13() > +{ > + // PR libstdc++/106320 > + auto l = std::views::transform([](auto x) { > + return x | std::views::transform([i=0](auto y) { > + return y; > + }); > + }); > + std::vector<std::vector<int>> v{{5, 6, 7}}; > + v | l | std::views::join; > +} > int > main() > { > @@ -220,4 +232,5 @@ main() > test10(); > test11(); > test12(); > + test13(); > } > -- > 2.37.3.542.gdd3f6c4cae > >
diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc index 8986f718229..530ab6663b5 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc @@ -205,6 +205,18 @@ test12() }(); } +void +test13() +{ + // PR libstdc++/106320 + auto l = std::views::transform([](auto x) { + return x | std::views::transform([i=0](auto y) { + return y; + }); + }); + std::vector<std::vector<int>> v{{5, 6, 7}}; + v | l | std::views::join; +} int main() { @@ -220,4 +232,5 @@ main() test10(); test11(); test12(); + test13(); }