From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id BB8AA3835818; Sat, 1 Jun 2024 08:22:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB8AA3835818 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB8AA3835818 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::631 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717230130; cv=none; b=lxXn59aFRrz8h9Qaj4U8Y7kFnPHv7W1RoDHtqa88vzVj4DFhPpfS8OZU5jDUkVmF96hq7r6H30AGuWEwX90sS3gO3YzR0r5FXiI0/qe9ju1ReMY8LEKYYeoi3i+AkDRmJIVwGSw8DTl/v9xd9s/NPgAVRAnzG0lDFEbrhrtDPwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717230130; c=relaxed/simple; bh=gze9K/UiuKtN+o6JwLViZj6XZFq3XsjwiXbmnl+FnLY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=fdB6K1SgsrD3UUjBdIXNFybnConWxd2TBua7gcwfAng8U1/9PoK4sYUP2gM2WexNNu6pxXn6obFgO+VMI21+npJaogUWwmp16NKJygYbu/0MOrVx6lgPV7jnFtsh7jJP+yOadac/TzpXXIaunPWAENVDuYxlNOwKSNUTNVcLn3k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a68bf84d747so14593566b.3; Sat, 01 Jun 2024 01:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717230124; x=1717834924; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=low/hwvJdDjKIGTwaucxeepQm8pirfXPm/CIFSbHPF8=; b=NAUH2mk9y0JrcDNad1My/WIy4jBtRUAyFejz/iB7IzZaTenGhe/40QPwmwO+Ng7aFN /2+wyktqsugOtiuxe8XYweA3+dAr0XrhU2hlLMBSA/npUAZ/X5NnxGm83MgCdUIfW71P wG68lfRW6UlgchuxW897sju6jy0OuqXoegBTy5DoMrmtqvUorDZS4fw8ArPm9XjieKEq 08ku/KWiyv5JQl8Kln69Tf6IesWrkUOQtcSX3BgSxn8KYVHy29ABJDLMCmpHyF1EYF4I JVz4YX+oR1KYO14uGpcy0fjIDY9pHteleeCilRUeENElHVSz2YNWnBl13wyTKOB2+QI8 2kMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717230124; x=1717834924; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=low/hwvJdDjKIGTwaucxeepQm8pirfXPm/CIFSbHPF8=; b=ZDRIAcpa/N4ipJExnCuisNlKndltpsOxIlBGNH5IE6xmEWFXzIPa+ZN9RLsmmEpQNk Ea8CCFD7DuPCe7C4T5DSGeuqDcNpzfsjhPL+YIlEWaBMu51F85j6vONAjE2BdTbkGHxJ i62F7oizvju/gNhEcNnbscvHce79htFaYmQjz7oWlr6QvyVOCOmlkFKJsQR4ln2mz8A0 6gUPXz9z/wY09iniV2L4j6Go3gAsrTPhfEX3Lh3tt5Sa/L2UW5ssDEZoYRKk1HvDjTaX GJW+YR4gZUGHhD3nsjl6hi6AZqaZFW7zPKTyJi/z9A0PL1NQw2yKv3dpycxfw9+coaGa rdCw== X-Forwarded-Encrypted: i=1; AJvYcCW3BFSk6oZ2Zt9R/U9XBJ+U7YQs7IIjfX2iiJAmCzE30eknfs766KwZFLv1nRs8A6pTLXG6BZF1uu7W8Kssn5athJRjYkkzssnIvY8BcCH9EWp23kGslqup1UAAcv/m X-Gm-Message-State: AOJu0YwObVIVHkBL6MsV8IB28d7cy8nUw1OaD4N/Qgz68XAk0+Fj8Ehg Q+XX3C03YlNd05wxrLhuVFe49Yq5xz4aJgmgDJ8nHncEwUKoCEwZEr91rc9iTcdif5k/eUUJyHx KRfVMaewipxMzkp/VD6L/pZBJjss= X-Google-Smtp-Source: AGHT+IET3AD9Nd8wAGWzzOy1dax2ZbT7P0fuWhHXqdlScpUoggotfmHJmWj43fwftvPTHGmr2U4PCvh8KflP48VUR2Y= X-Received: by 2002:a17:906:258d:b0:a5c:dcd4:351b with SMTP id a640c23a62f3a-a6821982787mr260080966b.58.1717230123989; Sat, 01 Jun 2024 01:22:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Sat, 1 Jun 2024 09:21:53 +0100 Message-ID: Subject: Re: [PATCH v2] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__ To: Alexandre Oliva Cc: Jonathan Wakely , hainque@adacore.com, libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, Matthias Kretz Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 31 May 2024 at 18:43, Alexandre Oliva wrote: > > On May 31, 2024, Alexandre Oliva wrote: > > >> So either don't change this line at all, or just do a simple > >> s/__clang__/_GLIBCXX_CLANG/ > > > If c++config can be counted on, I'd be happy to do that, but I couldn't > > tell that it could. > > Here's what I've retested on x86_64-linux-gnu and, slightly adjusted for > gcc-13, on arm-vx7r2. Ok to install? OK If there's any chance of getting the vxworks system headers fixed to work with GCC properly, that would be nice. > > > [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__ > > A proprietary embedded operating system that uses clang as its primary > compiler ships headers that require __clang__ to be defined. Defining > that macro causes libstdc++ to adopt workarounds that work for clang > but that break for GCC. > > So, introduce a _GLIBCXX_CLANG macro, and a convention to test for it > rather than for __clang__, so that a GCC variant that adds -D__clang__ > to satisfy system headers can also -D_GLIBCXX_CLANG=0 to avoid > workarounds that are not meant for GCC. > > I've left fast_float and ryu files alone, their tests for __clang__ > don't seem to be harmful for GCC, they don't include bits/c++config, > and patching such third-party files would just make trouble for > updating them without visible benefit. pstl_config.h, though also > imported, required adjustment. > > > for libstdc++-v3/ChangeLog > > * include/bits/c++config (_GLIBCXX_CLANG): Define or undefine. > * include/bits/locale_facets_nonio.tcc: Test for it. > * include/bits/stl_bvector.h: Likewise. > * include/c_compatibility/stdatomic.h: Likewise. > * include/experimental/bits/simd.h: Likewise. > * include/experimental/bits/simd_builtin.h: Likewise. > * include/experimental/bits/simd_detail.h: Likewise. > * include/experimental/bits/simd_x86.h: Likewise. > * include/experimental/simd: Likewise. > * include/std/complex: Likewise. > * include/std/ranges: Likewise. > * include/std/variant: Likewise. > * include/pstl/pstl_config.h: Likewise. > --- > libstdc++-v3/include/bits/c++config | 13 ++++++++++++- > libstdc++-v3/include/bits/locale_facets_nonio.tcc | 2 +- > libstdc++-v3/include/bits/stl_bvector.h | 2 +- > libstdc++-v3/include/c_compatibility/stdatomic.h | 2 +- > libstdc++-v3/include/experimental/bits/simd.h | 14 +++++++------- > .../include/experimental/bits/simd_builtin.h | 4 ++-- > .../include/experimental/bits/simd_detail.h | 8 ++++---- > libstdc++-v3/include/experimental/bits/simd_x86.h | 12 ++++++------ > libstdc++-v3/include/experimental/simd | 2 +- > libstdc++-v3/include/pstl/pstl_config.h | 4 ++-- > libstdc++-v3/include/std/complex | 4 ++-- > libstdc++-v3/include/std/ranges | 8 ++++---- > libstdc++-v3/include/std/variant | 2 +- > 13 files changed, 44 insertions(+), 33 deletions(-) > > diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config > index b57e3f338e92a..6dca2d9467aa5 100644 > --- a/libstdc++-v3/include/bits/c++config > +++ b/libstdc++-v3/include/bits/c++config > @@ -481,9 +481,20 @@ _GLIBCXX_END_NAMESPACE_VERSION > // Define if compatibility should be provided for -mlong-double-64. > #undef _GLIBCXX_LONG_DOUBLE_COMPAT > > +// Use an alternate macro to test for clang, so as to provide an easy > +// workaround for systems (such as vxworks) whose headers require > +// __clang__ to be defined, even when compiling with GCC. > +#if !defined _GLIBCXX_CLANG && defined __clang__ > +# define _GLIBCXX_CLANG __clang__ > +// Turn -D_GLIBCXX_CLANG=0 into -U_GLIBCXX_CLANG, so that > +// _GLIBCXX_CLANG can be tested as defined, just like __clang__. > +#elif !_GLIBCXX_CLANG > +# undef _GLIBCXX_CLANG > +#endif > + > // Define if compatibility should be provided for alternative 128-bit long > // double formats. Not possible for Clang until __ibm128 is supported. > -#ifndef __clang__ > +#ifndef _GLIBCXX_CLANG > #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT > #endif > > diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc b/libstdc++-v3/include/bits/locale_facets_nonio.tcc > index 8f67be5a6147b..72136f42f0866 100644 > --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc > +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc > @@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 > ctype<_CharT> const& __ctype = use_facet >(__loc); > __err = ios_base::goodbit; > bool __use_state = false; > -#if __GNUC__ >= 5 && !defined(__clang__) > +#if __GNUC__ >= 5 && !defined(_GLIBCXX_CLANG) > #pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wpmf-conversions" > // Nasty hack. The C++ standard mandates that get invokes the do_get > diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h > index d567e26f4e430..52153cadf8f70 100644 > --- a/libstdc++-v3/include/bits/stl_bvector.h > +++ b/libstdc++-v3/include/bits/stl_bvector.h > @@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER > void > _M_assume_normalized() const > { > -#if __has_attribute(__assume__) && !defined(__clang__) > +#if __has_attribute(__assume__) && !defined(_GLIBCXX_CLANG) > unsigned int __ofst = _M_offset; > __attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit)))); > #endif > diff --git a/libstdc++-v3/include/c_compatibility/stdatomic.h b/libstdc++-v3/include/c_compatibility/stdatomic.h > index 52daa16c9b1ed..5403b52a036d1 100644 > --- a/libstdc++-v3/include/c_compatibility/stdatomic.h > +++ b/libstdc++-v3/include/c_compatibility/stdatomic.h > @@ -125,7 +125,7 @@ using std::atomic_flag_clear_explicit; > using std::atomic_thread_fence; > using std::atomic_signal_fence; > > -#elif defined __clang__ > +#elif defined _GLIBCXX_CLANG > # include_next > #endif // __cpp_lib_stdatomic_h > #endif // _GLIBCXX_STDATOMIC_H > diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h > index 7c52462571902..ea034138fd720 100644 > --- a/libstdc++-v3/include/experimental/bits/simd.h > +++ b/libstdc++-v3/include/experimental/bits/simd.h > @@ -606,7 +606,7 @@ template > static_assert(_Bytes > 0); > if constexpr (_Bytes == sizeof(int)) > return int(); > - #ifdef __clang__ > + #ifdef _GLIBCXX_CLANG > else if constexpr (_Bytes == sizeof(char)) > return char(); > #else > @@ -615,7 +615,7 @@ template > #endif > else if constexpr (_Bytes == sizeof(short)) > return short(); > - #ifndef __clang__ > + #ifndef _GLIBCXX_CLANG > else if constexpr (_Bytes == sizeof(long)) > return long(); > #endif > @@ -1720,7 +1720,7 @@ template > __builtin_memcpy(&__r, &__v, sizeof(_To)); > return __r; > } > -#if _GLIBCXX_SIMD_X86INTRIN && !defined __clang__ > +#if _GLIBCXX_SIMD_X86INTRIN && !defined _GLIBCXX_CLANG > else if constexpr (__have_avx && sizeof(_From) == 16 && sizeof(_To) == 32) > return reinterpret_cast<_To>(__builtin_ia32_ps256_ps( > reinterpret_cast<__vector_type_t>(__v))); > @@ -1975,7 +1975,7 @@ template > > // }}} > // __andnot{{{ > -#if _GLIBCXX_SIMD_X86INTRIN && !defined __clang__ > +#if _GLIBCXX_SIMD_X86INTRIN && !defined _GLIBCXX_CLANG > static constexpr struct > { > _GLIBCXX_SIMD_INTRINSIC __v4sf > @@ -2035,7 +2035,7 @@ static constexpr struct > operator()(__v8di __a, __v8di __b) const noexcept > { return _mm512_andnot_si512(__a, __b); } > } _S_x86_andnot; > -#endif // _GLIBCXX_SIMD_X86INTRIN && !__clang__ > +#endif // _GLIBCXX_SIMD_X86INTRIN && !_GLIBCXX_CLANG > > template > _GLIBCXX_SIMD_INTRINSIC constexpr _TW > @@ -2046,7 +2046,7 @@ template > using _TVT = conditional_t<__is_simd_wrapper_v<_TW>, _TW, > _VectorTraitsImpl<_TW>>; > using _Tp = typename _TVT::value_type; > -#if _GLIBCXX_SIMD_X86INTRIN && !defined __clang__ > +#if _GLIBCXX_SIMD_X86INTRIN && !defined _GLIBCXX_CLANG > if constexpr (sizeof(_TW) >= 16) > { > const auto __ai = __to_intrin(__a); > @@ -2095,7 +2095,7 @@ template > using _Tp = remove_reference_t()[0])>; > using _RV [[maybe_unused]] = __vector_type_t<_Tp, sizeof...(_Is)>; > #if __has_builtin(__builtin_shufflevector) > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > // Clang requires _T0 == _T1 > if constexpr (sizeof(__x) > sizeof(__y) and _N1 == 1) > return __vec_shuffle(__x, _T0{__y[0]}, __seq, __idx_perm); > diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstdc++-v3/include/experimental/bits/simd_builtin.h > index 505f8083794e7..4abc750cfa1c2 100644 > --- a/libstdc++-v3/include/experimental/bits/simd_builtin.h > +++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h > @@ -1177,7 +1177,7 @@ struct _CommonImplBuiltin > constexpr size_t _Bytes = _ReqBytes == 0 ? sizeof(__x) : _ReqBytes; > static_assert(sizeof(__x) >= _Bytes); > > -#if !defined __clang__ && _GLIBCXX_SIMD_WORKAROUND_PR90424 > +#if !defined _GLIBCXX_CLANG && _GLIBCXX_SIMD_WORKAROUND_PR90424 > if constexpr (__is_vector_type_v<_TV>) > _S_memcpy<_Bytes>(reinterpret_cast(__addr), reinterpret_cast(&__x)); > else > @@ -2022,7 +2022,7 @@ template > return __vector_bitcast(_S_plus_minus(__x4, __y)); > } > #endif > -#if !defined __clang__ && __GCC_IEC_559 == 0 > +#if !defined _GLIBCXX_CLANG && __GCC_IEC_559 == 0 > if (__builtin_is_constant_evaluated() > || (__builtin_constant_p(__x) && __builtin_constant_p(__y))) > return (__x + __y) - __y; > diff --git a/libstdc++-v3/include/experimental/bits/simd_detail.h b/libstdc++-v3/include/experimental/bits/simd_detail.h > index 51e130bd36a5e..9ddf912a62b03 100644 > --- a/libstdc++-v3/include/experimental/bits/simd_detail.h > +++ b/libstdc++-v3/include/experimental/bits/simd_detail.h > @@ -262,7 +262,7 @@ > #endif > //}}} > > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > #define _GLIBCXX_SIMD_NORMAL_MATH > #define _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA > #else > @@ -277,7 +277,7 @@ > #define _GLIBCXX_SIMD_IS_UNLIKELY(__x) __builtin_expect(__x, 0) > #define _GLIBCXX_SIMD_IS_LIKELY(__x) __builtin_expect(__x, 1) > > -#if _GLIBCXX_SIMD_HAVE_SVE || __STRICT_ANSI__ || defined __clang__ > +#if _GLIBCXX_SIMD_HAVE_SVE || __STRICT_ANSI__ || defined _GLIBCXX_CLANG > #define _GLIBCXX_SIMD_CONSTEXPR > #define _GLIBCXX_SIMD_USE_CONSTEXPR_API const > #else > @@ -285,7 +285,7 @@ > #define _GLIBCXX_SIMD_USE_CONSTEXPR_API constexpr > #endif > > -#if defined __clang__ > +#if defined _GLIBCXX_CLANG > #define _GLIBCXX_SIMD_USE_CONSTEXPR const > #else > #define _GLIBCXX_SIMD_USE_CONSTEXPR constexpr > @@ -330,7 +330,7 @@ > #endif > > // integer division not optimized > -#ifndef __clang__ > +#ifndef _GLIBCXX_CLANG > #define _GLIBCXX_SIMD_WORKAROUND_PR90993 1 > #endif > > diff --git a/libstdc++-v3/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h > index 517c4b4a5bec7..4ab933b573c61 100644 > --- a/libstdc++-v3/include/experimental/bits/simd_x86.h > +++ b/libstdc++-v3/include/experimental/bits/simd_x86.h > @@ -363,7 +363,7 @@ template > > // }}} > > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > template > _GLIBCXX_SIMD_INTRINSIC constexpr auto > __movm(_Kp __k) noexcept > @@ -408,7 +408,7 @@ template > else > __assert_unreachable<_Tp>(); > } > -#endif // __clang__ > +#endif // _GLIBCXX_CLANG > > #ifdef _GLIBCXX_SIMD_WORKAROUND_PR85048 > #include "simd_x86_conversions.h" > @@ -674,7 +674,7 @@ struct _CommonImplX86 : _CommonImplBuiltin > using _Tp = typename _VectorTraits<_TV>::value_type; > static_assert(sizeof(_TV) >= 16); > static_assert(sizeof(_Tp) <= 8); > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > return __movm<_VectorTraits<_TV>::_S_full_size, _Tp>(__k) ? __b : __a; > #else > using _IntT > @@ -3505,9 +3505,9 @@ template > // optimize masked unary increment and decrement as masked sub +/-1 > constexpr int __pm_one > = is_same_v<_Op, __increment> ? -1 : 1; > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > return __movm<_Np, _Tp>(__k._M_data) ? __v._M_data - __pm_one : __v._M_data; > -#else // __clang__ > +#else // _GLIBCXX_CLANG > using _TV = __vector_type_t<_Tp, _Np>; > constexpr size_t __bytes = sizeof(__v) < 16 ? 16 : sizeof(__v); > constexpr size_t __width = __bytes / sizeof(_Tp); > @@ -3561,7 +3561,7 @@ template > #undef _GLIBCXX_SIMD_MASK_SUB_512 > #undef _GLIBCXX_SIMD_MASK_SUB > } > -#endif // __clang__ > +#endif // _GLIBCXX_CLANG > } > else > return _Base::template _S_masked_unary<_Op>(__k, __v); > diff --git a/libstdc++-v3/include/experimental/simd b/libstdc++-v3/include/experimental/simd > index f45ad4ed2e6cc..d2d081e0d1a2a 100644 > --- a/libstdc++-v3/include/experimental/simd > +++ b/libstdc++-v3/include/experimental/simd > @@ -59,7 +59,7 @@ > #pragma GCC diagnostic push > // Many [[gnu::vector_size(N)]] types might lead to a -Wpsabi warning which is > // irrelevant as those functions never appear on ABI borders > -#ifndef __clang__ > +#ifndef _GLIBCXX_CLANG > #pragma GCC diagnostic ignored "-Wpsabi" > #endif > > diff --git a/libstdc++-v3/include/pstl/pstl_config.h b/libstdc++-v3/include/pstl/pstl_config.h > index ccb9dd32838d3..7157a8a492ed9 100644 > --- a/libstdc++-v3/include/pstl/pstl_config.h > +++ b/libstdc++-v3/include/pstl/pstl_config.h > @@ -53,7 +53,7 @@ > // the actual GCC version on the system. > #define _PSTL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > > -#if defined(__clang__) > +#if defined(_GLIBCXX_CLANG) > // according to clang documentation, version can be vendor specific > # define _PSTL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) > #endif > @@ -62,7 +62,7 @@ > #if (defined(_OPENMP) && _OPENMP >= 201307) || \ > (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1600) || \ > (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \ > - defined(__clang__) > + defined(_GLIBCXX_CLANG) > # define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd) > # define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd) > # define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM)) > diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex > index 415c735665c3e..be810b6d05d25 100644 > --- a/libstdc++-v3/include/std/complex > +++ b/libstdc++-v3/include/std/complex > @@ -47,7 +47,7 @@ > // Get rid of a macro possibly defined in > #undef complex > > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wc99-extensions" > #endif > @@ -2646,7 +2646,7 @@ _GLIBCXX_END_NAMESPACE_VERSION > > #endif // C++11 > > -#ifdef __clang__ > +#ifdef _GLIBCXX_CLANG > #pragma clang diagnostic pop > #endif > > diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges > index b1e827c9a7241..3f335b95a0864 100644 > --- a/libstdc++-v3/include/std/ranges > +++ b/libstdc++-v3/include/std/ranges > @@ -4687,7 +4687,7 @@ namespace views::__adaptor > class zip_view<_Vs...>::_Iterator > : public __detail::__zip_view_iter_cat<_Const, _Vs...> > { > -#ifdef __clang__ // LLVM-61763 workaround > +#ifdef _GLIBCXX_CLANG // LLVM-61763 workaround > public: > #endif > tuple>...> _M_current; > @@ -4710,7 +4710,7 @@ namespace views::__adaptor > return input_iterator_tag{}; > } > > -#ifndef __clang__ // LLVM-61763 workaround > +#ifndef _GLIBCXX_CLANG // LLVM-61763 workaround > template > requires (view<_Ws> && ...) && (sizeof...(_Ws) > 0) && is_object_v<_Fp> > && regular_invocable<_Fp&, range_reference_t<_Ws>...> > @@ -5387,7 +5387,7 @@ namespace views::__adaptor > template > class adjacent_view<_Vp, _Nm>::_Iterator > { > -#ifdef __clang__ // LLVM-61763 workaround > +#ifdef _GLIBCXX_CLANG // LLVM-61763 workaround > public: > #endif > using _Base = __detail::__maybe_const_t<_Const, _Vp>; > @@ -5430,7 +5430,7 @@ namespace views::__adaptor > > friend class adjacent_view; > > -#ifndef __clang__ // LLVM-61763 workaround > +#ifndef _GLIBCXX_CLANG // LLVM-61763 workaround > template > requires view<_Wp> && (_Mm > 0) && is_object_v<_Fp> > && regular_invocable<__detail::__unarize<_Fp&, _Mm>, range_reference_t<_Wp>> > diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant > index 371cbb90f54a6..51aaa62085170 100644 > --- a/libstdc++-v3/include/std/variant > +++ b/libstdc++-v3/include/std/variant > @@ -1758,7 +1758,7 @@ namespace __detail::__variant > }, __rhs); > } > > -#if defined(__clang__) && __clang_major__ <= 7 > +#if defined(_GLIBCXX_CLANG) && __clang_major__ <= 7 > public: > using _Base::_M_u; // See https://bugs.llvm.org/show_bug.cgi?id=31852 > #endif > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive