Add constexpr to std::optional::value_or(U&&)&&
authorJonathan Wakely <jwakely@redhat.com>
Wed, 17 Apr 2019 13:13:30 +0000 (14:13 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 17 Apr 2019 13:13:30 +0000 (14:13 +0100)
commit02c9b9ccffc66ec68ad4c2a0786c00984563d863
tree7cf052c6da992e58be5c83b6916ec71c700838c3
parent2fa9c1f65f59e893064937c35a46c804b924cb55
Add constexpr to std::optional::value_or(U&&)&&

In C++1z drafts up to N4606 the constexpr keyword was missing from the
detailed description of this function, despite being shown in the class
synopsis.  That was fixed editorially for N4618, but our implementation
was not corrected to match.

* include/std/optional (optional::value_or(U&&) &&): Add missing
constexpr specifier.
* testsuite/20_util/optional/constexpr/observers/4.cc: Check value_or
for disengaged optionals and rvalue optionals.
* testsuite/20_util/optional/observers/4.cc: Likewise.

From-SVN: r270409
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/constexpr/observers/4.cc
libstdc++-v3/testsuite/20_util/optional/observers/4.cc