]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add constexpr to std::optional::value_or(U&&)&&
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2019 13:13:30 +0000 (13:13 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2019 13:13:30 +0000 (13:13 +0000)
commit88dbeb045d25ece78e5b698fe016facde65c190c
tree7cf052c6da992e58be5c83b6916ec71c700838c3
parentbd8c0b0125f85cc295d992193326a92df88a9f81
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270409 138bc75d-0d04-0410-961f-82ee72b054a4
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