Debian Codegraph @

libstdc++-v3/testsuite/std/ranges/conv/lwg4229.cc

raw
1 // { dg-do compile { target c++23 } }
2
3 // LWG 4229 std::ranges::to with union return type
4
5 #include <ranges>
6
7 union U
8 {
9 template<std::ranges::input_range R> U(std::from_range_t, R&&) { }
10
11 int i;
12 };
13
14 void
15 test_lwg4229(std::ranges::subrange<int*> r)
16 {
17 U u = std::ranges::to<U>(r);
18 }