[libcxx-commits] [libcxx] [libc++][test] Disable test coverage for `_BitInt` for MSVC STL (PR #212435)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 28 02:21:02 PDT 2026


https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/212435

>From 9e1f1d99de0c704917551a29847c4714c1d1012f Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 28 Jul 2026 17:01:40 +0800
Subject: [PATCH 1/2] [libc++][test] Disable test coverage for `_BitInt` for
 MSVC STL

Currently, MSVC STL has no plan to support `_BitInt`. However, when
using Clang with MSVC STL, `TEST_HAS_BITINT` is currently `1` as the
condition only detects compiler support of `_BitInt`.

This patch disables `_BitInt` coverage for MSVC STL for now.
---
 libcxx/test/support/test_macros.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 78b1f6eda6576..d9bca7e018e2a 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -45,7 +45,8 @@
 // _BitInt(N) is a C23 standard feature and a Clang extension in earlier C and C++.
 // __BITINT_MAXWIDTH__ is the portable probe: defined by every compiler that accepts _BitInt.
 // Note __has_extension(bit_int) is unusable because it is not recognized by Clang and produces 0.
-#ifdef __BITINT_MAXWIDTH__
+// Currently, MSVC STL has no plan to support _BitInt(N). So we should not enable test coverage for it.
+#if defined(__BITINT_MAXWIDTH__) && !defined(_MSVC_STL_VERSION)
 #  define TEST_HAS_BITINT 1
 #else
 #  define TEST_HAS_BITINT 0

>From e0a2a36b89593cb05820761123050fc517f74d80 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 28 Jul 2026 17:20:49 +0800
Subject: [PATCH 2/2] Make the condition strictly libc++-specific

---
 libcxx/test/support/test_macros.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index d9bca7e018e2a..971dd8ee34230 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -45,8 +45,9 @@
 // _BitInt(N) is a C23 standard feature and a Clang extension in earlier C and C++.
 // __BITINT_MAXWIDTH__ is the portable probe: defined by every compiler that accepts _BitInt.
 // Note __has_extension(bit_int) is unusable because it is not recognized by Clang and produces 0.
-// Currently, MSVC STL has no plan to support _BitInt(N). So we should not enable test coverage for it.
-#if defined(__BITINT_MAXWIDTH__) && !defined(_MSVC_STL_VERSION)
+// Currently, library support for _BitInt(N) is an extension explicitly supported by libc++,
+// and test coverage is disabled for other implementations.
+#if defined(__BITINT_MAXWIDTH__) && defined(_LIBCPP_VERSION)
 #  define TEST_HAS_BITINT 1
 #else
 #  define TEST_HAS_BITINT 0



More information about the libcxx-commits mailing list