libstdc++-v3/testsuite/20_util/optional/cons/117858.cc
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | |
| 3 | // PR 117858 std::optional with a constructor template<typename T> ctor(T) |
| 4 | // PR 117889 Failure to build qtwebengine-6.8.1 |
| 5 | |
| 6 | #include <optional> |
| 7 | |
| 8 | struct Focus |
| 9 | { |
| 10 | template<class T> Focus(T) { } |
| 11 | }; |
| 12 | |
| 13 | void test_pr117858(std::optional<Focus>& f) |
| 14 | { |
| 15 | f = f; |
| 16 | f = std::move(f); |
| 17 | } |
| 18 | |
| 19 | void test_pr117889(std::optional<Focus>& f) |
| 20 | { |
| 21 | std::optional<Focus> f2 = f; |
| 22 | std::optional<Focus> f3 = std::move(f); |
| 23 | } |