Details
- Reviewers
ldionne Mordante var-const nilayvaish - Group Reviewers
Restricted Project - Commits
- rG628fcfd5204c: [libc++] Add tests for std::string default constructor and destructor
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp | ||
---|---|---|
41 | std::string isn't constexpr yet. This will be uncommented when std::string is made constexpr (D110598 if you want to review it :P). | |
libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp | ||
33–35 | AFAICT this is supposed to be that way. The comment above says that it checks that the address of the destructors constructor can be taken. |
libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp | ||
---|---|---|
14 | This comment is no longer entirely true, because now this file also tests that the default constructor works and creates an empty string. I'd suggest moving it closer to the static assertions and rephrasing to something like Test the noexcept specification, which is a conforming extension.. | |
14 | If this is an extension, it seems like the test should use LIBCPP_STATIC_ASSERT (unless the other implementations just happen to do the same extension). If this test passes with GCC and MSVC, I wonder if the extension in question is fully tested? | |
41 | Can you please add a TODO to uncomment this line once that patch lands? In general, I think we should always add a TODO or at least a comment when committing commented out code. | |
libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp | ||
56–57 | Nit: can you use LIBCPP_STATIC_ASSERT? |
- Address comments
libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp | ||
---|---|---|
41 | I think a TODO doesn't make a lot of sense here. This commented out line exists in almost every single file in strings/basic.string. It just makes it harder to remove all the residue mechanically. |
LGTM, I think all comments have been addressed but please confirm with Costa before shipping, just to be sure.
libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp | ||
---|---|---|
41 | I agree with Costa in the general case, however in this specific instance the string tests have this commented out bit consistently, so I think this is fine as-is. Also we know we're going to uncomment it in the very short term. |
libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp | ||
---|---|---|
13 | Very optional nit: two blank lines in a row, I'd remove one. |
Very optional nit: two blank lines in a row, I'd remove one.