Comments (13)
Hello, can you please provide a testcase or some sample code for me to look at?
from luabind-deboostified.
I'm getting this on Ubuntu 16.04 with gcc 5.4.0, latest master:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LUABIND=ON .
make
[ 79%] Building CXX object test/CMakeFiles/test_policies.dir/test_policies.cpp.o
In file included from /home/pc/evan/projects/luabind-deboostified/test/test_policies.cpp:26:0:
/home/pc/evan/projects/luabind-deboostified/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/pc/evan/projects/luabind-deboostified/luabind/out_value_policy.hpp:200:34: error: wrong number of template arguments (1, should be 3)
storage_.template construct<T>();
^
In file included from /home/pc/evan/projects/luabind-deboostified/luabind/class.hpp:83:0,
from /home/pc/evan/projects/luabind-deboostified/luabind/luabind.hpp:28,
from /home/pc/evan/projects/luabind-deboostified/test/test_policies.cpp:25:
/home/pc/evan/projects/luabind-deboostified/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/pc/evan/projects/luabind-deboostified/test/test_policies.cpp:26:0:
/home/pc/evan/projects/luabind-deboostified/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/pc/evan/projects/luabind-deboostified/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/pc/evan/projects/luabind-deboostified/luabind/class.hpp:83:0,
from /home/pc/evan/projects/luabind-deboostified/luabind/luabind.hpp:28,
from /home/pc/evan/projects/luabind-deboostified/test/test_policies.cpp:25:
/home/pc/evan/projects/luabind-deboostified/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
CMakeFiles/Makefile2:2458: recipe for target 'test/CMakeFiles/test_policies.dir/all' failed
make[1]: *** [test/CMakeFiles/test_policies.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
from luabind-deboostified.
The Dockerfile below reproduces it on current master. Save it as Dockerfile.ubuntu
and build it like so:
cd luabind-deboostified
docker build -f Dockerfile.ubuntu .
# Dockerfile.ubuntu
FROM ubuntu:16.04
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
g++ \
gcc \
git \
lua5.1-dev \
make
RUN cd /tmp \
&& git clone https://github.com/decimad/luabind-deboostified.git
VOLUME /tmp/luabind-deboostified
RUN cd /tmp/luabind-deboostified \
&& cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLUABIND_BUILD_SHARED=ON . \
&& make
from luabind-deboostified.
Hello, thank you for the feedback, I will see what I can do shortly.
from luabind-deboostified.
I did further exploration last night.... using ubuntu:16.10
and gcc-6
elicits the same compiler error. But, compiling on ubuntu:16.10
and clang
works (with a minor fix I had to do which I'll make a PR for later today). I also tried C++14 standard with the same results.
I don't get why gcc is trying to use luabind::detail::construct
instead of out_value_detail::temporary_storage_size<Size>::construct
from luabind-deboostified.
So as I was saying... if I rename out_value_detail::temporary_storage_size<Size>::construct
to construct2
and invoke that in lines 200 and 221, then it compiles fine.
I don't think there is a proper test for this (because commenting out the line entirely still passes the test), but it is compiling.
from luabind-deboostified.
Man, I don't understand this problem. It smells like a compiler bug really?
from luabind-deboostified.
Oh and out_value_converter is missing the dependant template keywords as well...
from luabind-deboostified.
I commited a preliminary fix as suggested on https://www.c-plusplus.net/forum/343641 that works without renaming.
All this line does is default-constructing an object in the already reserved memory. A pointer to this will be passed to the function as the "out"-tagged parameter, which will get overwritten right away. Since an "int" holds no invariants that could be broken, that copy operation cannot fail. That's why the test still passes if you comment out that line, it could potentially break for non-trivial types though.
from luabind-deboostified.
I'll try to build that at me
from luabind-deboostified.
Okay, you also forgot to apply fix at 221'th line where I did fix myself, but another issue has been found:
impicit_cast test fails
./test_implicit_cast
/home/wohlstand/_git_repos/luabind-deboostified/test/test_implicit_cast.cpp:59"TEST_CHECK failed: "false""
But okay:
// This test fails because shared_ptr-converter is broken.
DOSTRING_EXPECTED(L,
"a = A()\n"
"no_convert(a)",
("No matching overload found, candidates:\n"
"void no_convert(custom ["
+ std::string(typeid(std::shared_ptr<A>).name()) + "])").c_str());
I'll post this as another issue (if someone wasn't posted it yet)
from luabind-deboostified.
Arrrr, I need to catch some sleep...
Btw.: This problem is/was actually a bug in gcc and clang.
from luabind-deboostified.
Okay, I think I can consider this fixed now, right?
from luabind-deboostified.
Related Issues (20)
- const references to floats do not work with object calls HOT 5
- runtime error when calling lua function from C++, passing a const char* HOT 6
- Returning a null smart pointer from C++ does not return a nil object HOT 9
- assertion failure in object_rep::add_dependency HOT 6
- Do you have any plans to extend initial functionality? HOT 2
- Support object_cast_nothrow with std::optional HOT 3
- Unit test "test_policies.cpp" fails to be build on GCC 6.3 because of "out_value_policy.hpp" HOT 1
- Dead code warning of Coverity Scan on "luabind/detail/format_signature.hpp" HOT 15
- test_implicit_cast.cpp test fails
- Lua classes from C++ HOT 33
- Terminate only when callback wasn't set HOT 4
- Which branch does not contain the boost dependency? HOT 1
- Calling C++ functions with default arguments from Lua HOT 8
- Multiple Return Values HOT 2
- Failed to build latest state (87897cf) on GCC 6.4.0 HOT 4
- set_package_preload?
- test_implicit_cast crashes gcc 4.7.3 HOT 2
- pure_out_value with discard_result HOT 3
- warning: class template partial specialization contains template parameters that can not be deduced; this partial specialization will never be used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luabind-deboostified.