From d094a3fd0ecfd1845b8a57a7d7ae9e637412260d Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Wed, 2 Jul 2025 08:48:53 -0600 Subject: [PATCH] :children_crossing: Work around clang bug with `consteval` UDLs Problem: - clang has a persistent regression where it ICEs with the error "trying to emit a call to an immediate function". This seems to be provoked by `consteval` UDLs. Solution: - When using clang, mark UDLs as `constexpr` rather than `consteval`. --- CMakeLists.txt | 2 +- include/groov/path.hpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0126e8b..66105fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ endif() add_versioned_package("gh:boostorg/mp11#boost-1.83.0") add_versioned_package("gh:intel/cpp-baremetal-concurrency#0ddce52") -add_versioned_package("gh:intel/cpp-std-extensions#7e1cbc7") +add_versioned_package("gh:intel/cpp-std-extensions#effadd4") add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#22c8006") find_package(Python3 COMPONENTS Interpreter) diff --git a/include/groov/path.hpp b/include/groov/path.hpp index 3eaea94..4c1fdf4 100644 --- a/include/groov/path.hpp +++ b/include/groov/path.hpp @@ -76,30 +76,36 @@ CONSTEVAL auto make_path() -> pathlike auto { } // namespace detail #if __clang__ && __clang_major__ <= 14 -template CONSTEVAL auto operator""_g() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_g() -> pathlike auto { constexpr auto s = stdx::ct_string{{chars..., 0}}; return detail::make_path(); } -template CONSTEVAL auto operator""_r() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_r() -> pathlike auto { constexpr auto s = stdx::ct_string{{chars..., 0}}; return detail::make_path(); } -template CONSTEVAL auto operator""_f() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_f() -> pathlike auto { constexpr auto s = stdx::ct_string{{chars..., 0}}; return detail::make_path(); } #else -template CONSTEVAL auto operator""_g() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_g() -> pathlike auto { return detail::make_path(); } -template CONSTEVAL auto operator""_r() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_r() -> pathlike auto { return detail::make_path(); } -template CONSTEVAL auto operator""_f() -> pathlike auto { +template +CONSTEVAL_UDL auto operator""_f() -> pathlike auto { return detail::make_path(); } #endif