There is probably a lot more we can do, in particular in <type_traits>,
but this removes workarounds that were gated on checking a specific
compiler version.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project Restricted Project - Commits
- rGa4cb5aefd545: [libc++] Remove some workarounds for unsupported GCC and Clang versions
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__config | ||
---|---|---|
1249 | Does this imply that there are supported versions of GCC where __has_attribute(fallthrough) reports the wrong answer? | |
1255–1261 | Let's merge these two #ifs. | |
libcxx/include/new | ||
335 | Is this function template missing _LIBCPP_HIDE_FROM_ABI / _LIBCPP_INLINE_VISIBILITY? | |
libcxx/include/type_traits | ||
3127–3128 | Is this implying that there's a supported version of GCC where __has_feature(is_trivially_constructible) returns the wrong answer? On old line 3344 you completely remove the __has_feature check; is that not appropriate here as well? | |
3517–3519 | I think this diff should be committed by itself as a separate commit, because I don't understand it. Nit: "Core 2094" should be spelled either "CWG 2094" or "CWG2094" for greppability. | |
libcxx/src/include/atomic_support.h | ||
27 | Surely defined(_LIBCPP_COMPILER_GCC) already implies !defined(__clang__). | |
libcxx/src/locale.cpp | ||
263–264 | FWIW, I recently had cause to try #pragma GCC diagnostic ignored "-Wall" in real code, and I found that it did nothing at all. I suspect -Wextra is similar. Try removing the pragmas and see if buildkite complains about anything and/or if the difference is observable. I bet it's not. | |
libcxxabi/src/include/atomic_support.h | ||
31 | Surely defined(_LIBCPP_COMPILER_GCC) implies !defined(__clang__). |
libcxx/include/__config | ||
---|---|---|
1249 | I tried to make my patch as NFC as possible, but I agree with you. | |
1255–1261 | ||
libcxx/include/new | ||
335 | ||
libcxx/include/type_traits | ||
3517–3519 | ||
libcxx/src/include/atomic_support.h | ||
27 | Note that as a follow-up, we could also figure out whether __ATOMIC_RELAXED & friends are always defined with Clang, and if so, remove this #if #else altogether. | |
libcxx/src/locale.cpp | ||
263–264 | I'll try it, but if we don't see any issue, it could also be that we suppress warnings in system headers (on GCC). On Clang we do the right thing in the test suite and we surface warnings even in system headers, but not on GCC. |
Does this imply that there are supported versions of GCC where __has_attribute(fallthrough) reports the wrong answer?
Orthogonally, scope creep, I wonder whether fallthrough should be __fallthrough__.