From 7eb298de757926a081e898a8578934beb2df211c Mon Sep 17 00:00:00 2001 From: Mykola Vankovych Date: Tue, 14 Jan 2025 16:48:47 +0100 Subject: [PATCH 1/2] Added fixes for building with clang 19 (more strict template matching rules) --- include/xtensor/containers/xstorage.hpp | 4 ++-- include/xtensor/core/xexpression_traits.hpp | 7 +++---- include/xtensor/utils/xutils.hpp | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/xtensor/containers/xstorage.hpp b/include/xtensor/containers/xstorage.hpp index 46318c259..a3185259a 100644 --- a/include/xtensor/containers/xstorage.hpp +++ b/include/xtensor/containers/xstorage.hpp @@ -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 struct rebind_container> { diff --git a/include/xtensor/core/xexpression_traits.hpp b/include/xtensor/core/xexpression_traits.hpp index 4328e54fb..5ec0f86fe 100644 --- a/include/xtensor/core/xexpression_traits.hpp +++ b/include/xtensor/core/xexpression_traits.hpp @@ -103,16 +103,15 @@ namespace xt using type = xarray; }; -#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