// { dg-options "-std=gnu++17" } // { dg-do compile { target c++17 } } #include #include #include using __gnu_test::SimpleAllocator; using value_type = std::set::value_type; static_assert(std::is_same_v< decltype(std::set{1, 2, 3}), std::set>); static_assert(std::is_same_v< decltype(std::set{1, 2, 3}), std::set>); static_assert(std::is_same_v< decltype(std::set{{1, 2, 3}, std::less{}, {}}), std::set>); static_assert(std::is_same_v< decltype(std::set{{1, 2, 3}, {}}), std::set>); static_assert(std::is_same_v< decltype(std::set{{1, 2, 3}, SimpleAllocator{}}), std::set, SimpleAllocator>>); static_assert(std::is_same_v< decltype(std::set{{1, 2, 3}, {}, SimpleAllocator{}}), std::set, SimpleAllocator>>); void f() { std::set x; static_assert(std::is_same_v< decltype(std::set(x.begin(), x.end())), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), std::less{}, std::allocator{}}), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), std::less{}, {}}), std::set>); static_assert(std::is_same_v< decltype(std::set(x.begin(), x.end(), {})), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), {}, std::allocator{}}), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), SimpleAllocator{}}), std::set, SimpleAllocator>>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), {}, SimpleAllocator{}}), std::set, SimpleAllocator>>); } using __gnu_test::test_container; using __gnu_test::input_iterator_wrapper; void g() { value_type array[1]; test_container x(array); static_assert(std::is_same_v< decltype(std::set(x.begin(), x.end())), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), std::less{}, std::allocator{}}), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), std::less{}, {}}), std::set>); static_assert(std::is_same_v< decltype(std::set(x.begin(), x.end(), {})), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), std::allocator{}}), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), SimpleAllocator{}}), std::set, SimpleAllocator>>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), {}, std::allocator{}}), std::set>); static_assert(std::is_same_v< decltype(std::set{x.begin(), x.end(), {}, SimpleAllocator{}}), std::set, SimpleAllocator>>); }