Skip to content

Commit 8a500d0

Browse files
committed
[FIX] clang-18: char_traits for non-character-types are deprecated
1 parent 164b7dd commit 8a500d0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build_system/seqan3-config.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION V
197197
message (FATAL_ERROR "Clang < 17 is not supported. The detected compiler version is ${CMAKE_CXX_COMPILER_VERSION}.")
198198
endif ()
199199

200+
# char_traits are deprecated in such a way that we get a deprecation error with -Werror while checking some traits
201+
# and concepts that should result in SFINAE. It seems like deprecation errors are ignored in requires clauses.
202+
# The easiest workaround seems to be to just remove the deprecation.
203+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
204+
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18
205+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
206+
set (SEQAN3_DEFINITIONS ${SEQAN3_DEFINITIONS} "-D_LIBCPP_CHAR_TRAITS_REMOVE_BASE_SPECIALIZATION")
207+
endif ()
208+
200209
# ----------------------------------------------------------------------------
201210
# Require C++20
202211
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)