Before implementing P2216's format-string adjust the unit tests.
After P2216 the format* functions require a compile-time string literal.
This changes prepares the tests.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG7277b00a29f0: [NFC][libc++][format] Prepare unit tests.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM with some comments.
libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp | ||
---|---|---|
27–28 | I would prefer if the tests could include what they use -- here we're using string_literal but we haven't included string_literal.h. I think we should not rely on the transitive include via format_tests.h. | |
libcxx/test/support/string_literal.h | ||
48–51 | Should those be private? |
Thanks for the review!
libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp | ||
---|---|---|
27–28 | In this case the test really requires format_tests.h to be included. But I agree it's good practice not to depend on transitive includes, so I'll fix it. | |
libcxx/test/support/string_literal.h | ||
48–51 | No that doesn't compile. I tried that, hence the comment at comment on line 27. I haven't looked at the exact rules of consteval, but I have a strong suspicion the class needs to be an aggregate. |
I would prefer if the tests could include what they use -- here we're using string_literal but we haven't included string_literal.h. I think we should not rely on the transitive include via format_tests.h.