decimad / luabind-deboostified

Create Lua bindings for your C++ code easily - my improvements
http://www.vrac.iastate.edu/vancegroup/docs/luabind/
Other
70 stars 27 forks source link

Unit test "test_policies.cpp" fails to be build on GCC 6.3 because of "out_value_policy.hpp" #30

Closed Wohlstand closed 7 years ago

Wohlstand commented 7 years ago

While I trying to build unit tests with CMake, the test_policies.cpp fails to be built with next error:

...

[ 92%] Built target test_extend_class_in_lua
Scanning dependencies of target test_policies
[ 93%] Building CXX object test/CMakeFiles/test_policies.dir/test_policies.cpp.o
In file included from /home/vitaly/_git_repos/luabind-deboostified-decimad/test/test_policies.cpp:26:0:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/out_value_policy.hpp: In member function ‘T& luabind::detail::pure_out_value_converter<Size, Policies>::to_cpp(lua_State*, luabind::detail::by_reference<T>, int)’:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/out_value_policy.hpp:200:46: error: wrong number of template arguments (1, should be 3)
                 storage_.template construct<T>();
                                              ^
In file included from /home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/class.hpp:83:0,
                 from /home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/luabind.hpp:28,
                 from /home/vitaly/_git_repos/luabind-deboostified-decimad/test/test_policies.cpp:25:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/detail/constructor.hpp:51:10: note: provided for ‘template<class T, class Pointer, class Signature> struct luabind::detail::construct’
   struct construct :
          ^~~~~~~~~
In file included from /home/vitaly/_git_repos/luabind-deboostified-decimad/test/test_policies.cpp:26:0:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/out_value_policy.hpp: In member function ‘T* luabind::detail::pure_out_value_converter<Size, Policies>::to_cpp(lua_State*, luabind::detail::by_pointer<T>, int)’:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/out_value_policy.hpp:221:34: error: wrong number of template arguments (1, should be 3)
     storage_.template construct<T>();
                                  ^
In file included from /home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/class.hpp:83:0,
                 from /home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/luabind.hpp:28,
                 from /home/vitaly/_git_repos/luabind-deboostified-decimad/test/test_policies.cpp:25:
/home/vitaly/_git_repos/luabind-deboostified-decimad/luabind/detail/constructor.hpp:51:10: note: provided for ‘template<class T, class Pointer, class Signature> struct luabind::detail::construct’
   struct construct :
          ^~~~~~~~~
test/CMakeFiles/test_policies.dir/build.make:62: recipe for target 'test/CMakeFiles/test_policies.dir/test_policies.cpp.o' failed
make[2]: *** [test/CMakeFiles/test_policies.dir/test_policies.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_policies.dir/all] Error 2
make: *** [all] Error 2
CMakeFiles/Makefile2:2762: recipe for target 'test/CMakeFiles/test_policies.dir/all' failed
Makefile:138: recipe for target 'all' failed

I have custom-installed GCC 6.3 via PPA on Linux Mint 18.1.

g++ (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 6.3.0 20170519
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Library itself builds fine and works with my game engine, but this unit tests fails to be built. Even I did clone of your current master state and did build: I'v got same compilation error.

I understand that I need to put two another template arguments to here (on two lines):

storage_.template construct<T, ????, ????>();

but I'm not sure which is right (I have tried to feed pointer/reference of T and "int", but that also fails)

decimad commented 7 years ago

This is a duplicate of issue #27 Please continue there.