]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement correct std::variant triviality rules from P0602R4
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Apr 2019 12:48:28 +0000 (13:48 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Apr 2019 12:48:28 +0000 (13:48 +0100)
commit038bc9bfd6dfd94336e0bebf416f1bbc3ed3272e
tree68753eed4c1e39d40a754061198ac3b40361b493
parent06715e1cfb475a89b2890951008e70325bdd0ce4
Implement correct std::variant triviality rules from P0602R4

The std::variant move assignment operator should not be trivial if the
variant is not trivially move constructible.

* include/std/variant (__detail::__variant::_Traits): Make
_S_trivial_copy_assign depend on _S_trivial_copy_ctor and make
_S_trivial_move_assign depend on _S_trivial_move_ctor, as per
P0602R4.
(__detail::__variant::_Copy_assign_alias): Only depend on
_S_trivial_copy_assign, which subsumes _S_trivial_copy_ctor now.
* testsuite/20_util/variant/compile.cc: Correct checks for trivial
move assignment operators.

From-SVN: r270510
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/variant/compile.cc