From: Jonathan Wakely Date: Sat, 30 Nov 2024 21:43:47 +0000 (+0000) Subject: libstdc++: Improve new testcase for std::optional assignment [PR117858] X-Git-Tag: basepoints/gcc-16~3719 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abed4806ddd75d4450c40f4064977024be460f4c;p=thirdparty%2Fgcc.git libstdc++: Improve new testcase for std::optional assignment [PR117858] The copy & paste bug affected two assignment operators, so ensure the new test covers both. libstdc++-v3/ChangeLog: PR libstdc++/117858 * testsuite/20_util/optional/assignment/117858.cc: Also test assignment from rvalue optional. --- diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/117858.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/117858.cc index 9443e1604846..e7045b37dd9c 100644 --- a/libstdc++-v3/testsuite/20_util/optional/assignment/117858.cc +++ b/libstdc++-v3/testsuite/20_util/optional/assignment/117858.cc @@ -13,4 +13,5 @@ struct Focus void g(std::optional f) { f = f; + f = std::move(f); }