This is an archive of the discontinued LLVM Phabricator instance.

[libc++] [C++20] [P0482] Add missing tests and synopses for char8_t.
ClosedPublic

Authored by curdeius on Mar 23 2021, 6:06 AM.

Details

Summary

Left to finish P0482:

  • <cuchar> header.
  • Parts of <memory_resource> concerning char8_t. Also, tests for hash<pmr::*string>.

Diff Detail

Event Timeline

curdeius requested review of this revision.Mar 23 2021, 6:06 AM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2021, 6:06 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

@ldionne, I've checked all the tests (hopefully not missing anything) and there's nothing else left in P0482 apart from the missing parts listed in the summary.

Quuxplusone added a subscriber: Quuxplusone.

LGTM FWIW.

libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
63

It might arguably be clearer to say

std::hash<str_t>
        h; // expected-error-re 4 {{{{call to implicitly-deleted default constructor of 'std::hash<str_t>'|implicit instantiation of undefined template}} {{.+}}}}}}
#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
    // expected-error@-2 {{call to implicitly-deleted default constructor}}
#endif

but I have no strong feelings. (I just now learned that expected-error@-2 5 ... is valid syntax.)

libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/types.pass.cpp
32

Cute that u8streampos and u16streampos are both just typedefs for std::fpos<std::mbstate_t>, so we can mix them up and C++ doesn't care. ;P

ldionne accepted this revision.Mar 23 2021, 7:55 AM

Thanks a lot for working on this! Let me know if you'd like to pick up D97870.

This revision is now accepted and ready to land.Mar 23 2021, 7:55 AM
curdeius marked an inline comment as done.Mar 23 2021, 8:03 AM
curdeius added inline comments.
libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
63

Indeed, will change when landing (hopefully not breaking anything).

libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/types.pass.cpp
32

Yeah, I laughed the moment I saw this :).

This revision was automatically updated to reflect the committed changes.
curdeius marked an inline comment as done.