Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/sol2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(../../cmake/CPM.cmake)

CPMAddPackage(
NAME lua
GIT_REPOSITORY https://github.com/lua/lua.git
GITHUB_REPOSITORY lua/lua
VERSION 5.3.5
DOWNLOAD_ONLY YES
)
Expand All @@ -21,7 +21,13 @@ if(lua_ADDED)
target_include_directories(lua SYSTEM PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
endif()

CPMAddPackage("gh:ThePhD/[email protected]")
CPMAddPackage(
NAME sol2
GITHUB_REPOSITORY ThePhD/sol2
VERSION 3.3.0
# fix for clang 18.1.0, see https://github.com/ThePhD/sol2/issues/1581#issuecomment-2103463524
PATCHES fix_for_clang.patch
)

# ---- Executable ----

Expand Down
18 changes: 18 additions & 0 deletions examples/sol2/fix_for_clang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff -u a/include/sol/function_types_stateless.hpp b/include/types/function_types_stateless.hpp
--- a/include/sol/function_types_stateless.hpp
+++ b/include/sol/function_types_stateless.hpp
@@ -322,7 +322,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);
Loading