Debian Codegraph @

libstdc++-v3/testsuite/20_util/optional/constexpr/modifiers.cc

raw
1 // { dg-do compile { target c++20 } }
2
3 #include <optional>
4 #include <testsuite_hooks.h>
5
6 constexpr bool
7 test_reset()
8 {
9 std::optional<int> oi(1);
10 oi.reset();
11 VERIFY( ! oi.has_value() );
12 oi.reset();
13 VERIFY( ! oi.has_value() );
14
15 return true;
16 }
17
18 static_assert( test_reset() );