re PR libstdc++/87855 (std::optional<T> only copy-constructible if T is trivially...
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 19 Nov 2018 15:05:18 +0000 (17:05 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 19 Nov 2018 15:05:18 +0000 (17:05 +0200)
commit4fea820523334138d7165f20333ef30ba8e01c1d
tree0828c69521fcbb3b64b70574083219e58f70668c
parentf615cb162df6f026d7f8798a74f0241df43251b1
re PR libstdc++/87855 (std::optional<T> only copy-constructible if T is trivially copy-constructible)

PR libstdc++/87855

Also implement P0602R4 (variant and optional
should propagate copy/move triviality) for std::optional.
* include/std/optional (_Optional_payload): Change
the main constraints to check constructibility in
addition to assignability.
(operator=): Make constexpr.
(_M_reset): Likewise.
(_M_construct): Likewise.
(operator->): Likewise.
* testsuite/20_util/optional/assignment/8.cc: Adjust.
* testsuite/20_util/optional/assignment/9.cc: New.

From-SVN: r266278
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/assignment/8.cc
libstdc++-v3/testsuite/20_util/optional/assignment/9.cc [new file with mode: 0644]