[libc-commits] [libc] [libc] Update minimum clang version for cfloat128. (PR #242396)
Alex Strelnikov via libc-commits
libc-commits at lists.llvm.org
Fri Nov 13 08:49:57 PST 2026
https://github.com/strel-12 created https://github.com/llvm/llvm-project/pull/242396
This fixes a build issue caused by #241999, which updated the minimum version for using `__float128`.
A follow-up will move LIBC_TYPES_HAS_FLOAT128 from llvm-libc-types/float128.h to llvm-libc-macros/ so it can be used in cfloat128-macros.h.
>From 17d0861ed7c48ea7c6ddd399c1d55c017daf2489 Mon Sep 17 00:00:00 2001
From: Alex Strelnikov <strel at google.com>
Date: Fri, 13 Nov 2026 16:41:36 +0000
Subject: [PATCH] Change minimum clang version for cfloat128.
---
libc/include/llvm-libc-macros/cfloat128-macros.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/include/llvm-libc-macros/cfloat128-macros.h b/libc/include/llvm-libc-macros/cfloat128-macros.h
index ff4aa530685de..e8e513944163f 100644
--- a/libc/include/llvm-libc-macros/cfloat128-macros.h
+++ b/libc/include/llvm-libc-macros/cfloat128-macros.h
@@ -14,12 +14,12 @@
// Currently, the complex variant of C23 `_Float128` type is only defined as a
// built-in type in GCC 7 or later, for C and in GCC 13 or later, for C++. For
// clang, the complex variant of `__float128` is defined instead, and only on
-// x86-64 targets for clang 11 or later.
+// x86-64 targets for clang 18.1 or later.
//
// TODO: Update the complex variant of C23 `_Float128` type detection again when
// clang supports it.
#ifdef __clang__
-#if (__clang_major__ >= 11) && \
+#if (__clang_major__ * 100 + __clang_minor__ >= 1801) && \
(defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__))
// Use _Complex __float128 type. clang uses __SIZEOF_FLOAT128__ or __FLOAT128__
// macro to notify the availability of __float128 type:
More information about the libc-commits
mailing list