From 25e8e53b98a2fb845a5089887fc60c2cd9db6239 Mon Sep 17 00:00:00 2001 From: scarf Date: Sat, 28 Sep 2024 03:58:51 +0900 Subject: [PATCH] build: fix build failure in clang 18 (#5441) it's a known llvm bug that isn't backported to clang 18 yet. applied workaround to sol2 instead. see: https://github.com/ThePhD/sol2/issues/1581#issuecomment-2103463524 --- src/sol/sol.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/sol/sol.hpp b/src/sol/sol.hpp index befd64414439..9a342d1833a2 100644 --- a/src/sol/sol.hpp +++ b/src/sol/sol.hpp @@ -19420,7 +19420,13 @@ namespace sol { namespace function_detail { } template - static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v) { + static int call(lua_State* L) +#if SOL_IS_ON(SOL_COMPILER_CLANG) + // apparent regression in clang 18 - llvm/llvm-project#91362 +#else + noexcept(std::is_nothrow_copy_assignable_v) +#endif + { int nr; if constexpr (no_trampoline) { nr = real_call(L); @@ -19460,7 +19466,13 @@ namespace sol { namespace function_detail { } template - static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v) { + static int call(lua_State* L) +#if SOL_IS_ON(SOL_COMPILER_CLANG) + // apparent regression in clang 18 - llvm/llvm-project#91362 +#else + noexcept(std::is_nothrow_copy_assignable_v) +#endif + { int nr; if constexpr (no_trampoline) { nr = real_call(L);