Skip to content

Added fixes for building with clang 19 #2821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/xtensor/xexpression_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ namespace xt
using type = xarray<T, L>;
};

#if defined(__GNUC__) && (__GNUC__ > 6)
#if __cplusplus == 201703L
// Workaround for rebind_container problems when C++17 feature is enabled
#ifdef __cpp_template_template_args
template <template <class, std::size_t, class, bool> class S, class X, std::size_t N, class A, bool Init>
struct xtype_for_shape<S<X, N, A, Init>>
{
template <class T, layout_type L>
using type = xarray<T, L>;
};
#endif // __cplusplus == 201703L
#endif // __GNUC__ && (__GNUC__ > 6)
#endif // __cpp_template_template_args

template <template <class, std::size_t> class S, class X, std::size_t N>
struct xtype_for_shape<S<X, N>>
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor/xstorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,8 +1637,8 @@ namespace xt
return !(lhs < rhs);
}

// Workaround for rebind_container problems on GCC 8 with C++17 enabled
#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L
// Workaround for rebind_container problems when C++17 feature is enabled
#ifdef __cpp_template_template_args
template <class X, class T, std::size_t N>
struct rebind_container<X, aligned_array<T, N>>
{
Expand Down
3 changes: 2 additions & 1 deletion include/xtensor/xutils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,8 @@ namespace xt
using type = C<X, allocator>;
};

#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L
// Workaround for rebind_container problems when C++17 feature is enabled
#ifdef __cpp_template_template_args
template <class X, class T, std::size_t N>
struct rebind_container<X, std::array<T, N>>
{
Expand Down
Loading