[libcxx-commits] [libcxx] [libc++] guard gcc diagnostic push in `bitset` (PR #94713)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 14 06:00:50 PDT 2024


================
@@ -375,11 +375,15 @@ template <size_t _N_words, size_t _Size>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long
 __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
   unsigned long long __r = __first_[0];
+#if defined(_LIBCPP_COMPILER_GCC)
----------------
ldionne wrote:

I have a slight preference for not doing this. We consistently don't do this throughout the code base, and we have the `_LIBCPP_GCC_DIAGNOSTIC_IGNORED` and `_LIBCPP_CLANG_DIAGNOSTIC_IGNORED` macros set up to avoid these `#ifdef`s. If it turns out that this triggers a bad compile-time behavior, we should instead look into changing the way we do this everywhere.

Not blocking, but that would be my take on this.

https://github.com/llvm/llvm-project/pull/94713


More information about the libcxx-commits mailing list