// { dg-options "-std=gnu++17" } // { dg-do compile { target c++17 } } // Copyright (C) 2018-2019 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . #include struct X { ~X(); }; struct Y { Y& operator=(const Y&) = default; Y& operator=(Y&&); Y(const Y&) = default; Y(Y&&) = default; }; struct Z { Z& operator=(const Z&); Z& operator=(Z&&) = default; Z(const Z&) = default; }; struct Y2 { Y2& operator=(const Y2&) = default; Y2& operator=(Y2&&); }; struct Z2 { Z2& operator=(const Z2&); Z2& operator=(Z2&&) = default; }; static_assert(std::is_trivially_copy_assignable_v>); static_assert(std::is_trivially_move_assignable_v>); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(!std::is_trivially_move_assignable_v>); static_assert(std::is_trivially_copy_assignable_v>); static_assert(!std::is_trivially_move_assignable_v>); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(std::is_trivially_move_assignable_v>); static_assert(std::is_trivially_copy_assignable_v); static_assert(!std::is_trivially_move_assignable_v); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(!std::is_trivially_move_assignable_v>); static_assert(!std::is_trivially_copy_assignable_v); static_assert(std::is_trivially_move_assignable_v); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(!std::is_trivially_move_assignable_v>); struct S { S(const S&&) = delete; S& operator=(const S&) = default; }; static_assert(std::is_trivially_copy_assignable_v); union U { char dummy; S s; }; static_assert(std::is_trivially_copy_assignable_v); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(!std::is_copy_assignable_v>); struct S2 { S2(S2&&) = delete; S2& operator=(const S2&) = default; }; static_assert(std::is_trivially_move_assignable_v); struct S3 { S3(const S3&); S3& operator=(const S3&) = default; }; static_assert(std::is_trivially_copy_assignable_v); static_assert(std::is_copy_assignable_v); static_assert(!std::is_trivially_copy_assignable_v>); static_assert(std::is_copy_assignable_v>); struct S4 { S4(S4&&); S4& operator=(S4&&) = default; }; static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_move_assignable_v); static_assert(!std::is_trivially_move_assignable_v>); static_assert(std::is_move_assignable_v>); union U2 { char dummy; S2 s; }; static_assert(std::is_trivially_move_assignable_v); static_assert(!std::is_trivially_move_assignable_v>); static_assert(!std::is_move_assignable_v>);