Cross-port the latest resolution of LWG2756 and some
commitc8bcfa5f4d956b3fed25f26692c567119e756ec1
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Oct 2016 12:46:44 +0000 (24 12:46 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Oct 2016 12:46:44 +0000 (24 12:46 +0000)
tree3a1b63e17adc7ada6334846b6f90783e87546b43
parent027318517ef913201562d38a9737a5e6d5598be6
Cross-port the latest resolution of LWG2756 and some
bug-fixes to experimental::optional.
PR libstdc++/77288
PR libstdc++/77727
* include/experimental/optional (_Optional_base):
Remove constructors that take a _Tp.
(__is_optional_impl, __is_optional): Remove.
(__converts_from_optional): New.
(optional(_Up&&)): Fix constraints, call base with in_place.
(optional(const optional<_Up>&)): Fix constraints, use emplace.
(optional(optional<_Up>&&)): Likewise.
(operator=(_Up&&)): Fix constraints.
(operator=(const optional<_Up>&)): Likewise.
(operator=(optional<_Up>&&)): Likewise.
(emplace(_Args&&...)): Constrain.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* testsuite/experimental/optional/77288.cc: New.
* testsuite/experimental/optional/assignment/5.cc: Adjust.
* testsuite/experimental/optional/cons/77727.cc: New.
* testsuite/experimental/optional/cons/value.cc: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241476 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/optional
libstdc++-v3/testsuite/experimental/optional/77288.cc [new file with mode: 0644]
libstdc++-v3/testsuite/experimental/optional/assignment/5.cc
libstdc++-v3/testsuite/experimental/optional/cons/77727.cc [copied from libstdc++-v3/testsuite/experimental/optional/assignment/5.cc with 52% similarity]
libstdc++-v3/testsuite/experimental/optional/cons/value.cc