Unverified Commit 84742cd8 authored by Stephan T. Lavavej's avatar Stephan T. Lavavej Committed by GitHub
Browse files

[libc++][test] Mark `optional` test functions as `TEST_CONSTEXPR_CXX20` (#94172)

[P2231R1](https://wg21.link/P2231R1) "Missing `constexpr` in
`std::optional` and `std::variant`" was accepted as a C++20 Defect
Report, not a C++17 Defect Report. Accordingly, `test_empty_emplace()`
and `check_reset()` should be marked as `TEST_CONSTEXPR_CXX20`. Note
that their `static_assert`s are properly guarded:


https://github.com/llvm/llvm-project/blob/4ce65423be0ba1d90c11b6a79981d6314e1cf36d/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp#L270-L272


https://github.com/llvm/llvm-project/blob/4ce65423be0ba1d90c11b6a79981d6314e1cf36d/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp#L53-L55

Found while running libc++'s tests with MSVC's STL, as we activate our
`constexpr` here for C++20 and above.
parent f4a7f81a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment