Code Monkey home page Code Monkey logo

Comments (13)

decimad avatar decimad commented on June 24, 2024

Hello, can you please provide a testcase or some sample code for me to look at?

from luabind-deboostified.

neomantra avatar neomantra commented on June 24, 2024

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.

neomantra avatar neomantra commented on June 24, 2024

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.

decimad avatar decimad commented on June 24, 2024

Hello, thank you for the feedback, I will see what I can do shortly.

from luabind-deboostified.

neomantra avatar neomantra commented on June 24, 2024

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.

neomantra avatar neomantra commented on June 24, 2024

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.

decimad avatar decimad commented on June 24, 2024

Man, I don't understand this problem. It smells like a compiler bug really?

from luabind-deboostified.

decimad avatar decimad commented on June 24, 2024

Oh and out_value_converter is missing the dependant template keywords as well...

from luabind-deboostified.

decimad avatar decimad commented on June 24, 2024

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.

Wohlstand avatar Wohlstand commented on June 24, 2024

I'll try to build that at me

from luabind-deboostified.

Wohlstand avatar Wohlstand commented on June 24, 2024

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.

decimad avatar decimad commented on June 24, 2024

Arrrr, I need to catch some sleep...
Btw.: This problem is/was actually a bug in gcc and clang.

from luabind-deboostified.

decimad avatar decimad commented on June 24, 2024

Okay, I think I can consider this fixed now, right?

from luabind-deboostified.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.