Skip to content

Commit e1d143a

Browse files
authored
Merge pull request #31 from iris-cpp/suppress-pack-indexing-warning
Suppress warnings for using pack indexing in C++23
2 parents 91b2707 + 6e4552e commit e1d143a

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ if(MSVC)
133133
)
134134
else()
135135
if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
136-
target_compile_options(_iris_cxx_common INTERFACE -fno-builtin-std-forward_like)
136+
target_compile_options(
137+
_iris_cxx_common
138+
INTERFACE
139+
-fno-builtin-std-forward_like
140+
-Wno-c++26-extensions # workaround for warnings emitted when using pack indexing
141+
)
137142
endif()
138143
target_compile_options(
139144
_iris_cxx_common

‎include/iris/type_traits.hpp‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ template<std::size_t I, class T>
5757
using at_c_t = at_c<I, T>::type;
5858

5959
#if __cpp_pack_indexing >= 202311L // has native pack indexing
60-
# if defined(__clang__)
61-
# pragma clang diagnostic push
62-
# pragma clang diagnostic ignored "-Wc++26-extensions"
63-
# endif
6460

6561
# define IRIS_CORE_PACK_INDEXING(I, Ts_ellipsis) Ts_ellipsis[I]
6662

@@ -74,9 +70,7 @@ struct at_c<I, TT<Ts...>>
7470
{
7571
using type = Ts...[I];
7672
};
77-
# if defined(__clang__)
78-
# pragma clang diagnostic pop
79-
# endif
73+
8074
// ----------------------------------------------------------
8175
#else // no native pack indexing
8276
template<std::size_t I, class... Ts>

0 commit comments

Comments
 (0)