Skip to content

Commit 11b5bc3

Browse files
authored
Merge branch 'master' into find_package_redirects_version
2 parents 2837d6d + 4b3a60f commit 11b5bc3

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

examples/sol2/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(../../cmake/CPM.cmake)
88

99
CPMAddPackage(
1010
NAME lua
11-
GIT_REPOSITORY https://github.com/lua/lua.git
11+
GITHUB_REPOSITORY lua/lua
1212
VERSION 5.3.5
1313
DOWNLOAD_ONLY YES
1414
)
@@ -21,7 +21,13 @@ if(lua_ADDED)
2121
target_include_directories(lua SYSTEM PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
2222
endif()
2323

24-
CPMAddPackage("gh:ThePhD/sol2@3.3.0")
24+
CPMAddPackage(
25+
NAME sol2
26+
GITHUB_REPOSITORY ThePhD/sol2
27+
VERSION 3.3.0
28+
# fix for clang 18.1.0, see https://github.com/ThePhD/sol2/issues/1581#issuecomment-2103463524
29+
PATCHES fix_for_clang.patch
30+
)
2531

2632
# ---- Executable ----
2733

examples/sol2/fix_for_clang.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff -u a/include/sol/function_types_stateless.hpp b/include/types/function_types_stateless.hpp
2+
--- a/include/sol/function_types_stateless.hpp
3+
+++ b/include/sol/function_types_stateless.hpp
4+
@@ -322,7 +322,13 @@ namespace sol { namespace function_detail {
5+
}
6+
7+
template <bool is_yielding, bool no_trampoline>
8+
- static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
9+
+ static int call(lua_State* L)
10+
+#if SOL_IS_ON(SOL_COMPILER_CLANG)
11+
+ // apparent regression in clang 18 - llvm/llvm-project#91362
12+
+#else
13+
+ noexcept(std::is_nothrow_copy_assignable_v<T>)
14+
+#endif
15+
+ {
16+
int nr;
17+
if constexpr (no_trampoline) {
18+
nr = real_call(L);

0 commit comments

Comments
 (0)