From 1dc0f53cda998a92ef309d2050baa0df45645e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 5 Mar 2024 21:08:40 -0500 Subject: [PATCH 1/3] Fix build on macOS with recent clang --- test/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/main.cpp b/test/main.cpp index 8800d0d..e2f2a77 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -54,7 +54,12 @@ Distributed under the Boost Software License, Version 1.0. retcode = 1; \ } -#ifdef __GNUC__ +#if defined(__clang__) +template struct is_literal_type +{ + static constexpr bool value = __is_literal_type(T); +}; +#elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct is_literal_type From 6fc408bca7821fe6771d1fce977e343174dfcb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 6 Mar 2024 10:36:03 -0500 Subject: [PATCH 2/3] Merge clang & msvc fix --- test/main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/main.cpp b/test/main.cpp index e2f2a77..5692284 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -54,7 +54,7 @@ Distributed under the Boost Software License, Version 1.0. retcode = 1; \ } -#if defined(__clang__) +#if defined(__clang__) || defined(_MSC_VER) template struct is_literal_type { static constexpr bool value = __is_literal_type(T); @@ -67,12 +67,6 @@ template struct is_literal_type static constexpr bool value = std::is_literal_type::value; }; #pragma GCC diagnostic pop -#elif defined(_MSC_VER) -template struct is_literal_type -{ - static constexpr bool value = __is_literal_type(T); -}; -#else #error "Don't know how to implement is_literal_type" #endif @@ -749,4 +743,4 @@ int main() printf("\nExiting tests with code %d\n", retcode); return retcode; -} \ No newline at end of file +} From 40307a937c6537d89a9346433f4e4278f983fb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 7 Mar 2024 16:21:56 -0500 Subject: [PATCH 3/3] is_literal_type: always use intrinsinc --- test/main.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/main.cpp b/test/main.cpp index 5692284..cbb7fc3 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -54,21 +54,10 @@ Distributed under the Boost Software License, Version 1.0. retcode = 1; \ } -#if defined(__clang__) || defined(_MSC_VER) template struct is_literal_type { static constexpr bool value = __is_literal_type(T); }; -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -template struct is_literal_type -{ - static constexpr bool value = std::is_literal_type::value; -}; -#pragma GCC diagnostic pop -#error "Don't know how to implement is_literal_type" -#endif // An error coding with multiple success values enum class Code : size_t