From 4f7f1af5152dde20cf02edac1f7ee8b51009bcc2 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Fri, 11 Aug 2017 10:21:15 -0400 Subject: [PATCH] trying to pin this error down... --- single/sol/sol.hpp | 15 +++++---- sol/usertype_metatable.hpp | 11 ++++--- test_container_semantics.cpp | 62 ++++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 37 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 42412a97..ab50a7b3 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2017-08-11 13:58:32.882633 UTC -// This header was generated with sol v2.18.0 (revision 10a59b2) +// Generated 2017-08-11 14:21:00.571402 UTC +// This header was generated with sol v2.18.0 (revision 644a5c5) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -14091,7 +14091,7 @@ namespace sol { } template - inline int operator_wrap(lua_State* L) { + int operator_wrap(lua_State* L) { auto maybel = stack::check_get(L, 1); if (maybel) { auto mayber = stack::check_get(L, 2); @@ -14112,7 +14112,8 @@ namespace sol { template = meta::enabler> inline void make_reg_op(Regs& l, int& index, const char* name) { - l[index] = luaL_Reg{ name, &c_call), &operator_wrap> }; + lua_CFunction f = &detail::static_trampoline<&operator_wrap>; + l[index] = luaL_Reg{ name, f }; ++index; } @@ -14124,7 +14125,8 @@ namespace sol { template = meta::enabler> inline void make_to_string_op(Regs& l, int& index) { const char* name = to_string(meta_function::to_string).c_str(); - l[index] = luaL_Reg{ name, &c_call), &default_to_string> }; + lua_CFunction f = &detail::static_trampoline<&default_to_string>; + l[index] = luaL_Reg{ name, f }; ++index; } @@ -14136,7 +14138,8 @@ namespace sol { template > = meta::enabler> inline void make_call_op(Regs& l, int& index) { const char* name = to_string(meta_function::call).c_str(); - l[index] = luaL_Reg{ name, &c_call }; + lua_CFunction f = &c_call; + l[index] = luaL_Reg{ name, f }; ++index; } diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index 30be716e..31573b4a 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -411,7 +411,7 @@ namespace sol { } template - inline int operator_wrap(lua_State* L) { + int operator_wrap(lua_State* L) { auto maybel = stack::check_get(L, 1); if (maybel) { auto mayber = stack::check_get(L, 2); @@ -432,7 +432,8 @@ namespace sol { template = meta::enabler> inline void make_reg_op(Regs& l, int& index, const char* name) { - l[index] = luaL_Reg{ name, &c_call), &operator_wrap> }; + lua_CFunction f = &detail::static_trampoline<&operator_wrap>; + l[index] = luaL_Reg{ name, f }; ++index; } @@ -444,7 +445,8 @@ namespace sol { template = meta::enabler> inline void make_to_string_op(Regs& l, int& index) { const char* name = to_string(meta_function::to_string).c_str(); - l[index] = luaL_Reg{ name, &c_call), &default_to_string> }; + lua_CFunction f = &detail::static_trampoline<&default_to_string>; + l[index] = luaL_Reg{ name, f }; ++index; } @@ -456,7 +458,8 @@ namespace sol { template > = meta::enabler> inline void make_call_op(Regs& l, int& index) { const char* name = to_string(meta_function::call).c_str(); - l[index] = luaL_Reg{ name, &c_call }; + lua_CFunction f = &c_call; + l[index] = luaL_Reg{ name, f }; ++index; } diff --git a/test_container_semantics.cpp b/test_container_semantics.cpp index b59c1d88..bd90a26c 100644 --- a/test_container_semantics.cpp +++ b/test_container_semantics.cpp @@ -1015,10 +1015,10 @@ end print(mop) )"); }()); - { - const my_object& mo = lua["mop"]; + REQUIRE_NOTHROW([&]() { + my_object& mo = lua["mop"]; REQUIRE((&mo == my_object::last_printed)); - } + }()); #endif REQUIRE_NOTHROW([&]() { lua.safe_script(R"( @@ -1028,10 +1028,12 @@ c_iterable = mo:iterable() )"); }()); - my_object& mo = lua["c_mo"]; - my_object& mo_iterable = lua["c_iterable"]; - REQUIRE(&mo == &mo_iterable); - REQUIRE(mo == mo_iterable); + REQUIRE_NOTHROW([&]() { + my_object& mo = lua["c_mo"]; + my_object& mo_iterable = lua["c_iterable"]; + REQUIRE(&mo == &mo_iterable); + REQUIRE(mo == mo_iterable); + }()); REQUIRE_NOTHROW([&]() { lua.safe_script(R"( @@ -1042,14 +1044,16 @@ s1_iterable_len = #c_iterable )"); }()); - std::size_t s1 = lua["s1"]; - std::size_t s1_len = lua["s1_len"]; - std::size_t s1_iterable = lua["s1_iterable"]; - std::size_t s1_iterable_len = lua["s1_iterable_len"]; - REQUIRE(s1 == 10); - REQUIRE(s1 == s1_len); - REQUIRE(s1 == s1_iterable_len); - REQUIRE(s1_iterable == s1_iterable_len); + REQUIRE_NOTHROW([&]() { + std::size_t s1 = lua["s1"]; + std::size_t s1_len = lua["s1_len"]; + std::size_t s1_iterable = lua["s1_iterable"]; + std::size_t s1_iterable_len = lua["s1_iterable_len"]; + REQUIRE(s1 == 10); + REQUIRE(s1 == s1_len); + REQUIRE(s1 == s1_iterable_len); + REQUIRE(s1_iterable == s1_iterable_len); + }()); REQUIRE_NOTHROW([&]() { lua.safe_script(R"( @@ -1073,16 +1077,20 @@ print(mo) )"); }()); - int v1 = lua["v1"]; - std::size_t s2 = lua["s2"]; - std::size_t s2_len = lua["s2_len"]; - std::size_t s2_iterable = lua["s2_iterable"]; - std::size_t s2_iterable_len = lua["s2_iterable_len"]; - - REQUIRE(v1 == 100); - REQUIRE(s2 == 16); - REQUIRE(s2 == s2_len); - REQUIRE(s2 == s2_iterable_len); - REQUIRE(s2_iterable == s2_iterable_len); - REQUIRE(&mo == my_object::last_printed); + REQUIRE_NOTHROW([&]() { + int v1 = lua["v1"]; + std::size_t s2 = lua["s2"]; + std::size_t s2_len = lua["s2_len"]; + std::size_t s2_iterable = lua["s2_iterable"]; + std::size_t s2_iterable_len = lua["s2_iterable_len"]; + REQUIRE(v1 == 100); + REQUIRE(s2 == 16); + REQUIRE(s2 == s2_len); + REQUIRE(s2 == s2_iterable_len); + REQUIRE(s2_iterable == s2_iterable_len); + }()); + REQUIRE_NOTHROW([&]() { + my_object& mo = lua["mo"]; + REQUIRE(&mo == my_object::last_printed); + }()); }