// { dg-do compile { target c++11 } } // { dg-require-effective-target hosted } #include template struct Alloc { using value_type = T; Alloc() noexcept(false) { } Alloc(const Alloc&) noexcept(false) { } template Alloc(const Alloc&) noexcept { } T* allocate(std::size_t); void deallocate(T*, std::size_t); bool operator==(const Alloc&) const noexcept(false) { return true; } bool operator!=(const Alloc&) const noexcept(false) { return false; } }; using A1 = std::allocator; using A2 = std::allocator; using Ax = Alloc; using SA1 = std::scoped_allocator_adaptor; using SA2 = std::scoped_allocator_adaptor; static_assert( std::is_default_constructible::value && ! std::is_nothrow_default_constructible::value, "default constructor is potentially-throwing" ); static_assert( std::is_nothrow_constructible::value, "multi-arg constructor is non-throwing" ); static_assert( std::is_nothrow_copy_constructible::value, "copy constructor is non-throwing" ); static_assert( std::is_nothrow_move_constructible::value, "move constructor is non-throwing" ); static_assert( std::is_nothrow_constructible::value, "converting copy constructor is non-throwing" ); static_assert( std::is_nothrow_constructible::value, "converting move constructor is non-throwing" ); static_assert( noexcept(std::declval().inner_allocator()), "inner_allocator() is non-throwing" ); static_assert( noexcept(std::declval().inner_allocator()), "inner_allocator() const is non-throwing" ); static_assert( noexcept(std::declval().outer_allocator()), "outer_allocator() is non-throwing" ); static_assert( noexcept(std::declval().outer_allocator()), "outer_allocator() const is non-throwing" );