libstdc++: Implement LWG 3886 for std::optional and std::expected
This uses remove_cv_t<T> for the default template argument used for deducing a type for a braced-init-list used with std::optional and std::expected. libstdc++-v3/ChangeLog: * include/std/expected (expected(U&&), operator=(U&&)) (value_or): Use remove_cv_t on default template argument, as per LWG 3886. * include/std/optional (optional(U&&), operator=(U&&)) (value_or): Likewise. * testsuite/20_util/expected/lwg3886.cc: New test. * testsuite/20_util/optional/cons/lwg3886.cc: New test.
Showing
- libstdc++-v3/include/std/expected 4 additions, 4 deletionslibstdc++-v3/include/std/expected
- libstdc++-v3/include/std/optional 6 additions, 6 deletionslibstdc++-v3/include/std/optional
- libstdc++-v3/testsuite/20_util/expected/lwg3886.cc 58 additions, 0 deletionslibstdc++-v3/testsuite/20_util/expected/lwg3886.cc
- libstdc++-v3/testsuite/20_util/optional/cons/lwg3886.cc 58 additions, 0 deletionslibstdc++-v3/testsuite/20_util/optional/cons/lwg3886.cc
Loading
Please register or sign in to comment