Open elsid opened 1 year ago
The problem is in sol::usertype_traits::metatable
function. It produces the same result for both lambda types because it relies on __PRETTY_FUNCTION__
therefore function pointer for the second one is not registered. Clang doesn't have this problem because __PRETTY_FUNCTION__
produces different results for different lambdas: https://godbolt.org/z/PxGrhMh7a.
Following code compiled with GCC and Clang produces different output:
Clang built program produces correct output:
GCC is wrong:
https://godbolt.org/z/dKG4rbdoe
Running this under debugger shows that here
fx
has value of&decltype(f0)::operator()
instead of&decltype(f1)::operator()
.