From 3c776fe72966627c2ffdc79d1ff0f04bef54d89a Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 15 Jan 2024 19:30:06 +0100 Subject: [PATCH 1/3] fix: workaround compiling with debug mode --- include/seqan3/core/platform.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index 79417e795b..8ba70390fe 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -259,8 +259,13 @@ static_assert(sdsl::sdsl_version_major == 3, "Only version 3 of the SDSL is supp # endif #endif -//!\brief Our char literals returning std::vector should be constexpr if constexpr std::vector is supported. -#if defined(__cpp_lib_constexpr_vector) && __cpp_lib_constexpr_vector >= 201907L +/*!\brief Our char literals returning std::vector should be constexpr if constexpr std::vector is supported. + * + * The _GLIBCXX_DEBUG statement is a workaround for a libstdc++ bug + * \see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104748 + * \see https://github.com/seqan/seqan3/issues/3221 + **/ +#if defined(__cpp_lib_constexpr_vector) && __cpp_lib_constexpr_vector >= 201907L && !defined(_GLIBCXX_DEBUG) # define SEQAN3_WORKAROUND_LITERAL constexpr #else # define SEQAN3_WORKAROUND_LITERAL inline From b864f72ca7a79d26de2627fd37b610c679f17dc5 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Wed, 17 Jan 2024 11:56:44 +0100 Subject: [PATCH 2/3] Patch: improve readability of std::vector debug mode fix Co-authored-by: Enrico Seiler --- include/seqan3/core/platform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index 8ba70390fe..701b22d54a 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -265,7 +265,7 @@ static_assert(sdsl::sdsl_version_major == 3, "Only version 3 of the SDSL is supp * \see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104748 * \see https://github.com/seqan/seqan3/issues/3221 **/ -#if defined(__cpp_lib_constexpr_vector) && __cpp_lib_constexpr_vector >= 201907L && !defined(_GLIBCXX_DEBUG) +#if __cpp_lib_constexpr_vector >= 201907L && (defined(_LIBCPP_VERSION) || !defined(_GLIBCXX_DEBUG)) # define SEQAN3_WORKAROUND_LITERAL constexpr #else # define SEQAN3_WORKAROUND_LITERAL inline From 3322897e01ecf7a09e9280be10a021d47922b394 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Wed, 17 Jan 2024 11:57:17 +0100 Subject: [PATCH 3/3] doc: add example of the underlying issue of the workaround Co-authored-by: Enrico Seiler --- include/seqan3/core/platform.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index 701b22d54a..506d0b3265 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -264,6 +264,7 @@ static_assert(sdsl::sdsl_version_major == 3, "Only version 3 of the SDSL is supp * The _GLIBCXX_DEBUG statement is a workaround for a libstdc++ bug * \see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104748 * \see https://github.com/seqan/seqan3/issues/3221 + * \see https://godbolt.org/z/159n8xrdo **/ #if __cpp_lib_constexpr_vector >= 201907L && (defined(_LIBCPP_VERSION) || !defined(_GLIBCXX_DEBUG)) # define SEQAN3_WORKAROUND_LITERAL constexpr