[libcxx-commits] [libcxx] [libcxx] Also ignore -Wshift-count-overflow in clang (PR #229087)

Aiden Grossman via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 5 20:02:59 PDT 2026


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/229087

>From cffe3f677436684409072c3db16fedfcc0feac39 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 5 Oct 2026 13:50:34 +0000
Subject: [PATCH] [libcxx] Also ignore -Wshift-count-overflow in clang

Clang now also diagnoses this. Also suppress the warning in clang so
that the build still passes (given it is -Werror by default). This
started happening with the release version of clang 23.
---
 libcxx/include/__cxx03/bitset | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxx/include/__cxx03/bitset b/libcxx/include/__cxx03/bitset
index f97431dd5fa09..7d029f78a4382 100644
--- a/libcxx/include/__cxx03/bitset
+++ b/libcxx/include/__cxx03/bitset
@@ -339,6 +339,7 @@ template <size_t _N_words, size_t _Size>
 _LIBCPP_HIDE_FROM_ABI unsigned long long __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
   unsigned long long __r = __first_[0];
   _LIBCPP_DIAGNOSTIC_PUSH
+  _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
   _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
   for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
     __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);



More information about the libcxx-commits mailing list