This, on top of D119134, allows enabling -Werror for the clang-cl
configurations.
Details
- Reviewers
ldionne philnik Mordante • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG8a0a706f096b: [libcxx] Wrap [[no_unique_address]] in a macro, for clang-cl
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
With this (and D119134) I think we could enable LIBCXX_ENABLE_WERROR in all CI configurations except for the couple GCC ones.
GCC builds seem to print (at least) this warning when building:
include/c++/v1/string:2267:32: error: enumerated and non-enumerated type in conditional expression [-Werror=extra] 2267 | size_type __cap = __is_short ? __min_cap : __get_long_cap();
libcxx/include/__ranges/join_view.h | ||
---|---|---|
72 | Oh, oops. Yes this is a victim of search-and-replace... |
I'm working on making the GCC build warning-free, but I don't know how long it will take. There are still quite a few problems.
LGTM! Do you want to make a similar commit to update the tests? I was there as a discussion on Discord, so please wait a bit before committing in case @ldionne wants to chime in.
libcxx/include/__config | ||
---|---|---|
1408 | Would it make sense to test this first? Then line 1401 doesn't need _MSC_VER and comment is only needed for msvc::no_unique_address. | |
1417 | I'm not sure we want to make this an error in the future. In general we don't do that so we can use these macros in older language standards. | |
libcxx/utils/ci/run-buildbot | ||
573 ↗ | (On Diff #407497) | Can you commit the changes to this file in a separate commit? |
Hmm, is this used in tests somewhere too? (Haven’t grepped there yet, on the phone right now.) Those are already built with -Werror iirc, so they should have caused an issue already, but I can look closer a bit later.
libcxx/include/__config | ||
---|---|---|
1408 | I think that could work too. Then I think we’d still be warning free, as __has_cpp_attribute() should indicate that it isn’t available in clang-cl now. | |
1417 | No strings opinion on that - but AFAIK we only use this in C++20-only contexts anyway, as we’d have an inconsistent ABI otherwise. | |
libcxx/utils/ci/run-buildbot | ||
573 ↗ | (On Diff #407497) | Yeah, it probably makes more sense to split out that too a separate commit - just bundled it here to show that we do get these configs warning free. |
I knew I had seen it, seems there's only one occurrence. Some other tests will probably start to fail in the near future since they contains XFAIL: msvc due to the lack of [[unique_address]] support.
libcxx/include/__config | ||
---|---|---|
1417 | @mstorsjo good point regarding the ABI, maybe add that in the comment as justification why we want to make in an #error after clang-cl support the attribute. @Quuxplusone I considered the same comment, but line 1398 disproves the statement ;-) _LIBCPP_EXTERN_TEMPLATE also has nothings. | |
1417 |
|
Reordered the preference between [[msvc::no_unique_address]] and [[no_unique_address]] as requestd, adjusted the comments based on that
libcxx/include/__ranges/join_view.h | ||
---|---|---|
72 | @Quuxplusone thanks for the ping here. I certainly don't know why the comment is here as you know. I'd be OK removing it (and also marking __base_ as _LIBCPP_NO_UNIQUE_ADDRESS FWIW - effectively what I did in https://reviews.llvm.org/D119208) |