Skip to content

Commit 33a583d

Browse files
[libc] Workaround for GCC on typedef for _Complex __float128 (#157010)
Currently, GCC can't parse `typedef _Complex __float128 cfloat128;`, although `__typeof__` can be used as a workaround. Reported https://gcc.gnu.org/PR121799 which was later considered as duplicate of https://gcc.gnu.org/PR32187. Some recent changes exposed it to GCC and then caused CI failure for libc++. This patch adds a workaround for GCC.
1 parent 8106c81 commit 33a583d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libc/include/llvm-libc-types/cfloat128.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313

1414
#ifdef LIBC_TYPES_HAS_CFLOAT128
1515
#ifndef LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE
16+
#if defined(__GNUC__) && !defined(__clang__)
17+
// Remove the workaround when https://gcc.gnu.org/PR32187 gets fixed.
18+
typedef __typeof__(_Complex __float128) cfloat128;
19+
#else // ^^^ workaround / no workaround vvv
1620
typedef _Complex __float128 cfloat128;
21+
#endif // ^^^ workaround ^^^
1722
#else
1823
typedef _Complex long double cfloat128;
1924
#endif // LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE

0 commit comments

Comments
 (0)