From 8a500d0649981ced74ea75fd13560a536bdd4ab3 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 7 Jun 2024 20:05:32 +0200 Subject: [PATCH] [FIX] clang-18: char_traits for non-character-types are deprecated --- build_system/seqan3-config.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build_system/seqan3-config.cmake b/build_system/seqan3-config.cmake index cb7988c91e..5dbd4b013e 100644 --- a/build_system/seqan3-config.cmake +++ b/build_system/seqan3-config.cmake @@ -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 # ----------------------------------------------------------------------------