Skip to content

Commit

Permalink
build: fix build failure in clang 18 (cataclysmbnteam#5441)
Browse files Browse the repository at this point in the history
it's a known llvm bug that isn't backported to clang 18 yet. applied workaround to sol2 instead.

see: ThePhD/sol2#1581 (comment)
  • Loading branch information
scarf005 authored Sep 27, 2024
1 parent 4f65973 commit 25e8e53
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/sol/sol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19420,7 +19420,13 @@ namespace sol { namespace function_detail {
}

template <bool is_yielding, bool no_trampoline>
static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
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<T>)
#endif
{
int nr;
if constexpr (no_trampoline) {
nr = real_call(L);
Expand Down Expand Up @@ -19460,7 +19466,13 @@ namespace sol { namespace function_detail {
}

template <bool is_yielding, bool no_trampoline>
static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
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<T>)
#endif
{
int nr;
if constexpr (no_trampoline) {
nr = real_call(L);
Expand Down

0 comments on commit 25e8e53

Please sign in to comment.