[libc++][test] Mark optional
test functions as TEST_CONSTEXPR_CXX20
#94172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
P2231R1 "Missing
constexpr
instd::optional
andstd::variant
" was accepted as a C++20 Defect Report, not a C++17 Defect Report. Accordingly,test_empty_emplace()
andcheck_reset()
should be marked asTEST_CONSTEXPR_CXX20
. Note that theirstatic_assert
s are properly guarded:llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
Lines 270 to 272 in 4ce6542
llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
Lines 53 to 55 in 4ce6542
Found while running libc++'s tests with MSVC's STL, as we activate our
constexpr
here for C++20 and above.