All supported compilers have implemented this feature.
Therefore use the language version instead of the feature macro.
Details
- Reviewers
philnik ldionne • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG93b333908d0d: [libc++] Remove _LIBCPP_HAS_NO_STRONG_ENUMS.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
+1 what Louis said; I was gonna say the same thing but he beat me to it. :) I doubt we support any compilers without cxx_strong_enums anymore, right?
Good point. It also seems Clang only supports it in C++11 and not in C++03.
In that case I prefer to remove _LIBCPP_HAS_NO_STRONG_ENUMS from the codebase and test for C++03 instead.
That the _LIBCPP_DECLARE_STRONG_ENUM macros will be gated by the language version.
Agreed on this approach?
SGTM!
(I wondered if the _LIBCPP_DECLARE_STRONG_ENUM macro could be completely eliminated, but no, I see that we do have at least one use, in <ios>, that needs to keep working in C++03 mode. And also in <future> for some reason; and maybe all its uses.)
To clarify in case it's needed: The guard around define _LIBCPP_DECLARE_STRONG_ENUM(x) should now use #if defined(_LIBCPP_CXX03_LANG). The macro _LIBCPP_HAS_NO_STRONG_ENUMS should vanish.
libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp | ||
---|---|---|
29 | To clarify in case it's needed: This should now use TEST_STD_VER >= 11. |
Correct that is the plan. So I revert this patch locally and grep for _LIBCPP_HAS_NO_STRONG_ENUMS, replace it with the proper version macro and reuse this review for the new approach.
Feel free to poke @ldionne and wait for his approval, but IMNSHO this patch now conforms to everything Louis was asking for. :) Thanks for doing this!
clang-format suggested style edits found: