Details
- Reviewers
• Quuxplusone Mordante var-const ldionne - Group Reviewers
Restricted Project - Commits
- rGe85018b7dd3a: [libc++] Prepare string.{access, capacity, cons} tests for constexpr
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
My expectation is that the commit that will actually implement constexpr string should then only uncomment those static_asserts and also should make the necessary changes in std::basic_string. That's exactly how this should be done, so this is great, however I am left wondering if that's really all the test changes that are going to be necessary.
libcxx/test/std/strings/basic.string/string.capacity/empty.pass.cpp | ||
---|---|---|
27–28 | Missing TEST_CONSTEXPR_CXX20. | |
libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp | ||
21 | Missing TEST_CONSTEXPR_CXX20. | |
libcxx/test/std/strings/basic.string/string.capacity/length.pass.cpp | ||
26–27 | Missing TEST_CONSTEXPR_CXX20. I think several other functions below are missing it too, so I'll stop here. | |
libcxx/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp | ||
104 | All of those should be #if TEST_STD_VER > 17 // static_assert(test()); #endif |
@ldionne No, they aren't all the changes, but most of them. I first want to make these very easy to verify changes and then the actual behavioral changes.
I think most of the rest are ignoring exception tests during constant evaluation, but I think it will be easier for everybody if I put all the else if (!TEST_IS_CONSTANT_EVALUATED) into a single PR.
libcxx/test/std/strings/basic.string/string.capacity/empty.pass.cpp | ||
---|---|---|
27–28 | The problem is that clang will warn on these. They aren't templates, so they have to be made constexpr with the functional changes. |
libcxx/test/std/strings/basic.string/string.capacity/empty.pass.cpp | ||
---|---|---|
27–28 | Oh, of course. Otherwise Clang complains about a constexpr function never being constexpr-friendly. |
Missing TEST_CONSTEXPR_CXX20.