Skip to content

Commit

Permalink
[FIX] clang-18: char_traits for non-character-types are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jun 7, 2024
1 parent 164b7dd commit 8a500d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build_system/seqan3-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION V
message (FATAL_ERROR "Clang < 17 is not supported. The detected compiler version is ${CMAKE_CXX_COMPILER_VERSION}.")
endif ()

# char_traits are deprecated in such a way that we get a deprecation error with -Werror while checking some traits
# and concepts that should result in SFINAE. It seems like deprecation errors are ignored in requires clauses.
# The easiest workaround seems to be to just remove the deprecation.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
set (SEQAN3_DEFINITIONS ${SEQAN3_DEFINITIONS} "-D_LIBCPP_CHAR_TRAITS_REMOVE_BASE_SPECIALIZATION")
endif ()

# ----------------------------------------------------------------------------
# Require C++20
# ----------------------------------------------------------------------------
Expand Down

0 comments on commit 8a500d0

Please sign in to comment.