libstdc++: Workaround Clang bug with __array_rank built-in [PR118559]
We started using the __array_rank built-in with r15-1252-g6f0dfa6f1acdf7 but that built-in is buggy in versions of Clang up to and including 19. libstdc++-v3/ChangeLog: PR libstdc++/118559 * include/std/type_traits (rank, rank_v): Do not use __array_rank for Clang 19 and older.
This commit is contained in:
parent
57f65c5c02
commit
c0e865f73d
1 changed files with 4 additions and 2 deletions
|
@ -1484,7 +1484,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
};
|
||||
|
||||
/// rank
|
||||
#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank)
|
||||
#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
|
||||
&& (!defined(__clang__) || __clang_major__ >= 20) // PR118559
|
||||
template<typename _Tp>
|
||||
struct rank
|
||||
: public integral_constant<std::size_t, __array_rank(_Tp)> { };
|
||||
|
@ -3656,7 +3657,8 @@ template <typename _Tp>
|
|||
template <typename _Tp>
|
||||
inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
|
||||
|
||||
#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank)
|
||||
#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
|
||||
&& (!defined(__clang__) || __clang_major__ >= 20) // PR118559
|
||||
template <typename _Tp>
|
||||
inline constexpr size_t rank_v = __array_rank(_Tp);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue