[libcxx-commits] [libcxx] [libc++] __need_infinity_nan doesn't work in non-gnu c++ standards (PR #172539)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 6 10:13:30 PST 2026
================
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// gcc supports "partitial inclusion" of some builtin headers via __need macros.
+// These are implemented in modules via textual headers, which are tricky to
+// support because libc++ needs to know about them and make its corresponding
+// headers textual too so that the macros are passed along.
+//
+// Another wrinkle is that __need macros can be used to force a type to be
+// when it wouldn't normally be. e.g. Apple platforms will use __need_rsize_t
+// to force the declaration of rsize_t to be visible even when
+// __STDC_WANT_LIB_EXT1__ isn't set.
+
+// gcc doesn't support all of the __need macros
+// UNSUPPORTED: gcc
+
+// The __need macros don't fully with in the frozen headers
+// UNSUPPORTED: c++03
----------------
ldionne wrote:
If you want to exclude this test from the C++03 frozen headers, the right incantation is `// XFAIL: FROZEN-CXX03-HEADERS-FIXME`.
```suggestion
// The frozen C++03 headers don't support the __need macros tested here.
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
```
https://github.com/llvm/llvm-project/pull/172539
More information about the libcxx-commits
mailing list