blob: 1e5f6f18408d1d1fd6f2319e9be01fa23317b2e5 [file] [log] [blame]
// { dg-do compile { target c++23 } }
// C++23 26.5.7 Range conversions [range.utility.conv]
#include <ranges>
#include <vector>
#include <testsuite_allocator.h>
void
test_2_1_5()
{
// (2.1.5) Otherwise, the program is ill-formed.
using Alloc = __gnu_test::uneq_allocator<int>;
using Vec = std::vector<int, Alloc>;
std::vector<int> v;
(void) std::ranges::to<Vec>(v, v.get_allocator()); // { dg-error "here" }
(void) std::ranges::to<Vec>(Vec{}, 1, 2, 3, 4, 5, 6); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }
// { dg-prune-output "no matching function" }