From c62f997e6ea46a90d96ddeca394933cc2eadcdb1 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Wed, 18 Dec 2024 11:37:35 +0100 Subject: [PATCH 1/2] Improve workaround clang bracket compilation bug --- include/experimental/__p0009_bits/config.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/experimental/__p0009_bits/config.hpp b/include/experimental/__p0009_bits/config.hpp index e8cacf40..d1865144 100644 --- a/include/experimental/__p0009_bits/config.hpp +++ b/include/experimental/__p0009_bits/config.hpp @@ -242,7 +242,10 @@ static_assert(_MDSPAN_CPLUSPLUS >= MDSPAN_CXX_STD_14, "mdspan requires C++14 or # if defined(__cpp_multidimensional_subscript) // The following if/else is necessary to workaround a clang issue // relative to using a parameter pack inside a bracket operator in C++2b/C++23 mode -# if defined(_MDSPAN_COMPILER_CLANG) && ((__clang_major__ == 15) || (__clang_major__ == 16)) +# if defined(_MDSPAN_COMPILER_CLANG) && \ + ((__clang_major__ < 17) || \ + (__clang_major__ == 17 && __clang_minor__ == 0 && \ + __clang_patchlevel__ < 1)) # define MDSPAN_USE_BRACKET_OPERATOR 0 # else # define MDSPAN_USE_BRACKET_OPERATOR 1 From d1158234d38f8b8a6e5cf61b5ae2a08d4d5be0b3 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Wed, 18 Dec 2024 15:43:06 +0100 Subject: [PATCH 2/2] Prefer __clang_patchlevel__ == 0 based on reviews --- include/experimental/__p0009_bits/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/experimental/__p0009_bits/config.hpp b/include/experimental/__p0009_bits/config.hpp index d1865144..a23d0135 100644 --- a/include/experimental/__p0009_bits/config.hpp +++ b/include/experimental/__p0009_bits/config.hpp @@ -245,7 +245,7 @@ static_assert(_MDSPAN_CPLUSPLUS >= MDSPAN_CXX_STD_14, "mdspan requires C++14 or # if defined(_MDSPAN_COMPILER_CLANG) && \ ((__clang_major__ < 17) || \ (__clang_major__ == 17 && __clang_minor__ == 0 && \ - __clang_patchlevel__ < 1)) + __clang_patchlevel__ == 0)) # define MDSPAN_USE_BRACKET_OPERATOR 0 # else # define MDSPAN_USE_BRACKET_OPERATOR 1