File tree 2 files changed +22
-24
lines changed
libcxx/test/std/utilities/optional/optional.object
2 files changed +22
-24
lines changed Original file line number Diff line number Diff line change @@ -210,16 +210,15 @@ void test_on_test_type() {
210
210
}
211
211
}
212
212
213
- constexpr bool test_empty_emplace ()
214
- {
215
- optional<const int > opt;
216
- auto &v = opt.emplace (42 );
217
- static_assert ( std::is_same_v<const int &, decltype (v)>, " " );
218
- assert (*opt == 42 );
219
- assert ( v == 42 );
220
- opt.emplace ();
221
- assert (*opt == 0 );
222
- return true ;
213
+ TEST_CONSTEXPR_CXX20 bool test_empty_emplace () {
214
+ optional<const int > opt;
215
+ auto & v = opt.emplace (42 );
216
+ static_assert (std::is_same_v<const int &, decltype (v)>, " " );
217
+ assert (*opt == 42 );
218
+ assert (v == 42 );
219
+ opt.emplace ();
220
+ assert (*opt == 0 );
221
+ return true ;
223
222
}
224
223
225
224
int main (int , char **)
Original file line number Diff line number Diff line change @@ -31,20 +31,19 @@ struct X
31
31
32
32
bool X::dtor_called = false ;
33
33
34
- constexpr bool check_reset ()
35
- {
36
- {
37
- optional<int > opt;
38
- static_assert (noexcept (opt.reset ()) == true , " " );
39
- opt.reset ();
40
- assert (static_cast <bool >(opt) == false );
41
- }
42
- {
43
- optional<int > opt (3 );
44
- opt.reset ();
45
- assert (static_cast <bool >(opt) == false );
46
- }
47
- return true ;
34
+ TEST_CONSTEXPR_CXX20 bool check_reset () {
35
+ {
36
+ optional<int > opt;
37
+ static_assert (noexcept (opt.reset ()) == true , " " );
38
+ opt.reset ();
39
+ assert (static_cast <bool >(opt) == false );
40
+ }
41
+ {
42
+ optional<int > opt (3 );
43
+ opt.reset ();
44
+ assert (static_cast <bool >(opt) == false );
45
+ }
46
+ return true ;
48
47
}
49
48
50
49
int main (int , char **)
You can’t perform that action at this time.
0 commit comments