[gcc r15-5834] libstdc++: Improve new testcase for std::optional assignment [PR117858]

Jonathan Wakely redi@gcc.gnu.org
Sat Nov 30 21:45:42 GMT 2024


https://gcc.gnu.org/g:abed4806ddd75d4450c40f4064977024be460f4c

commit r15-5834-gabed4806ddd75d4450c40f4064977024be460f4c
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Nov 30 21:43:47 2024 +0000

    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:
---
 libstdc++-v3/testsuite/20_util/optional/assignment/117858.cc | 1 +
 1 file changed, 1 insertion(+)

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<Focus> f)
 {
   f = f;
+  f = std::move(f);
 }


More information about the Libstdc++-cvs mailing list