Skip to content

Commit

Permalink
Merge pull request #364 from tpadioleau/fix-clang-bracket-issue
Browse files Browse the repository at this point in the history
Fix clang bug with parameter packs and bracket operators
  • Loading branch information
dalg24 authored Nov 8, 2024
2 parents 260f525 + 2109307 commit 771e3ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/experimental/__p0009_bits/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,13 @@ static_assert(_MDSPAN_CPLUSPLUS >= MDSPAN_CXX_STD_14, "mdspan requires C++14 or

#ifndef MDSPAN_USE_BRACKET_OPERATOR
# if defined(__cpp_multidimensional_subscript)
# define MDSPAN_USE_BRACKET_OPERATOR 1
// 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))
# define MDSPAN_USE_BRACKET_OPERATOR 0
# else
# define MDSPAN_USE_BRACKET_OPERATOR 1
# endif
# else
# define MDSPAN_USE_BRACKET_OPERATOR 0
# endif
Expand Down

0 comments on commit 771e3ca

Please sign in to comment.