Use _LIBCPP_NO_HAS_CHAR8_T to test if template should be specialized.
Details
- Reviewers
ldionne mclow.lists - Group Reviewers
Restricted Project - Commits
- rGb526d8761895: [libc++] Add std::hash<char8_t> specialization if char8_t is enabled
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There is a chance that _LIBCPP_NO_HAS_CHAR8_T should be removed in the course of https://reviews.llvm.org/D92212
Could you please, take a look and share you thoughts?
Commented there.
For the record, the link is https://reviews.llvm.org/D92212 (without the trailing slash.
Alternately, you can just write D92212 and Phab will figure it out.
Use libc++-specific macro to rest if hashing should be enabled.
Continue using standard defined macro in tests.
libcxx/test/libcxx/extensions/hash/specializations.pass.cpp | ||
---|---|---|
26 ↗ | (On Diff #308368) | I think test (due to being a library client) should continue checking the flag defined by the standard __cpp_lib_char8_t. I have fixed it to check the value of the macro, |
libcxx/test/libcxx/extensions/hash/specializations.pass.cpp | ||
---|---|---|
26 ↗ | (On Diff #308368) | Since the test is libc++-specific (it's in the test/libcxx hierarchy, as opposed to test/std), it *could* use _LIBCPP_NO_HAS_CHAR8_T. However, this is fine. |
We can still proceed with this even though we're keeping _LIBCPP_NO_HAS_CHAR8_T.
This LGTM.
The attempt to test std::hash via _gnu_cxx was just wrong.
I can not find any place to put individual hash tests anywhere, so I am removing the test completely.
I think this should be #ifndef _LIBCPP_NO_HAS_CHAR8_T