Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile cellspp using clang++ 3.5 #1

Open
sepi opened this issue Jan 20, 2014 · 5 comments
Open

Can't compile cellspp using clang++ 3.5 #1

sepi opened this issue Jan 20, 2014 · 5 comments

Comments

@sepi
Copy link

sepi commented Jan 20, 2014

I get the following error messages after trying to compile under debian wheezy with libc++ from testing.

$ make 2>out

out:

In file included from cells-test.cpp:17:
In file included from ./cells.hpp:109:
./cells-impl.hpp:58:61: error: type of thread-local variable has non-trivial destruction
  static thread_local dynvar<std::forward_list<observer*> > current_dependencies;
                                                            ^
./cells-impl.hpp:58:61: note: use 'thread_local' to allow this
./cells-impl.hpp:59:43: error: type of thread-local variable has non-trivial destruction
  static thread_local dynvar<transaction> current_transaction;
                                          ^
./cells-impl.hpp:59:43: note: use 'thread_local' to allow this
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type 'cells::observer *' cannot bind to lvalue of type 'cells::observer *'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, cells::observer *&&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/memory:4290:26: note: in instantiation of function template specialization 'std::__1::__shared_ptr_emplace<cells::observer *, std::__1::allocator<cells::observer *> >::__shared_ptr_emplace<cells::observer *>' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/usr/include/c++/v1/memory:4649:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<cells::observer *>::make_shared<cells::observer *>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
./cells-impl.hpp:61:43: note: in instantiation of function template specialization 'std::__1::make_shared<cells::observer *, cells::observer *>' requested here
  inline observer::observer() : self(std::make_shared<observer*>(this)) { };
                                          ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type '<lambda at ./cells-impl.hpp:120:24>' cannot bind to lvalue of type '<lambda at ./cells-impl.hpp:120:24>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, <lambda at ./cells-impl.hpp:120:24> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1600:26: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:120:24>, std::__1::allocator<<lambda at ./cells-impl.hpp:120:24> >, void ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
./cells-impl.hpp:120:24: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at ./cells-impl.hpp:120:24> >' requested here
      with_transaction([&]() { this->mark(); });
                       ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at ./cells-impl.hpp:120:24> > &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1608:34: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:120:24>, std::__1::allocator<<lambda at ./cells-impl.hpp:120:24> >, void ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
./cells-impl.hpp:120:24: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at ./cells-impl.hpp:120:24> >' requested here
      with_transaction([&]() { this->mark(); });
                       ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type '<lambda at ./cells-impl.hpp:219:65>' cannot bind to lvalue of type '<lambda at ./cells-impl.hpp:219:65>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, <lambda at ./cells-impl.hpp:219:65> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1600:26: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:219:65>, std::__1::allocator<<lambda at ./cells-impl.hpp:219:65> >, void ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
./cells-impl.hpp:219:65: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at ./cells-impl.hpp:219:65> >' requested here
    with<transaction, void>(current_transaction, transaction(), [&]() -> void {
                                                                ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at ./cells-impl.hpp:219:65> > &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1608:34: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:219:65>, std::__1::allocator<<lambda at ./cells-impl.hpp:219:65> >, void ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
./cells-impl.hpp:219:65: note: in instantiation of function template specialization 'std::__1::function<void ()>::function<<lambda at ./cells-impl.hpp:219:65> >' requested here
    with<transaction, void>(current_transaction, transaction(), [&]() -> void {
                                                                ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type '<lambda at ./cells-impl.hpp:191:26>' cannot bind to lvalue of type '<lambda at ./cells-impl.hpp:191:26>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, <lambda at ./cells-impl.hpp:191:26> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1600:26: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:191:26>, std::__1::allocator<<lambda at ./cells-impl.hpp:191:26> >, double (double)>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/usr/include/c++/v1/functional:1701:5: note: in instantiation of function template specialization 'std::__1::function<double (double)>::function<<lambda at ./cells-impl.hpp:191:26> >' requested here
    function(_VSTD::forward<_Fp>(__f)).swap(*this);
    ^
./cells-impl.hpp:191:23: note: in instantiation of function template specialization 'std::__1::function<double (double)>::operator=<<lambda at ./cells-impl.hpp:191:26> >' requested here
    this->alt_formula = ([=](T) { return value; });
                      ^
cells-test.cpp:41:10: note: in instantiation of member function 'cells::formula_cell<double>::reset' requested here
      x0.reset(10);
         ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at ./cells-impl.hpp:191:26> > &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1608:34: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:191:26>, std::__1::allocator<<lambda at ./cells-impl.hpp:191:26> >, double (double)>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
/usr/include/c++/v1/functional:1701:5: note: in instantiation of function template specialization 'std::__1::function<double (double)>::function<<lambda at ./cells-impl.hpp:191:26> >' requested here
    function(_VSTD::forward<_Fp>(__f)).swap(*this);
    ^
./cells-impl.hpp:191:23: note: in instantiation of function template specialization 'std::__1::function<double (double)>::operator=<<lambda at ./cells-impl.hpp:191:26> >' requested here
    this->alt_formula = ([=](T) { return value; });
                      ^
cells-test.cpp:41:10: note: in instantiation of member function 'cells::formula_cell<double>::reset' requested here
      x0.reset(10);
         ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type '<lambda at ./cells-impl.hpp:192:26>' cannot bind to lvalue of type '<lambda at ./cells-impl.hpp:192:26>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, <lambda at ./cells-impl.hpp:192:26> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1600:26: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:192:26>, std::__1::allocator<<lambda at ./cells-impl.hpp:192:26> >, double ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/usr/include/c++/v1/functional:1701:5: note: in instantiation of function template specialization 'std::__1::function<double ()>::function<<lambda at ./cells-impl.hpp:192:26> >' requested here
    function(_VSTD::forward<_Fp>(__f)).swap(*this);
    ^
./cells-impl.hpp:192:23: note: in instantiation of function template specialization 'std::__1::function<double ()>::operator=<<lambda at ./cells-impl.hpp:192:26> >' requested here
    this->formula     = ([=]()  { return value; });
                      ^
cells-test.cpp:41:10: note: in instantiation of member function 'cells::formula_cell<double>::reset' requested here
      x0.reset(10);
         ^
In file included from cells-test.cpp:17:
In file included from ./cells.hpp:22:
In file included from /usr/include/c++/v1/functional:489:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:330:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:329:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:447:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<<lambda at ./cells-impl.hpp:192:26> > &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1608:34: note: in instantiation of member function 'std::__1::__function::__func<<lambda at ./cells-impl.hpp:192:26>, std::__1::allocator<<lambda at ./cells-impl.hpp:192:26> >, double ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
/usr/include/c++/v1/functional:1701:5: note: in instantiation of function template specialization 'std::__1::function<double ()>::function<<lambda at ./cells-impl.hpp:192:26> >' requested here
    function(_VSTD::forward<_Fp>(__f)).swap(*this);
    ^
./cells-impl.hpp:192:23: note: in instantiation of function template specialization 'std::__1::function<double ()>::operator=<<lambda at ./cells-impl.hpp:192:26> >' requested here
    this->formula     = ([=]()  { return value; });
                      ^
cells-test.cpp:41:10: note: in instantiation of member function 'cells::formula_cell<double>::reset' requested here
      x0.reset(10);
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [cells-test] Error 1
@ghost
Copy link

ghost commented May 8, 2014

Here I made fixes to compile it under Linux, check them out: https://github.com/procedural/cellspp

@benkard
Copy link
Owner

benkard commented May 13, 2014

@procedural Cool! Please send me a pull request. :)

@ghost
Copy link

ghost commented May 13, 2014

Are you sure? I deleted thread_local defines and removed libc++ from the makefile, wouldn't these changes break compiling on Mac OS? Check it: https://github.com/procedural/cellspp/commit/b8436894a269d0cbe54ff6ce696ad2585325a790

@benkard
Copy link
Owner

benkard commented May 13, 2014

Yes, the patch looks good. libc++ is the default on OS X, so it's going to use it regardless of whether we specify it or not. And __thread is wrong anyway. :)

@ghost
Copy link

ghost commented May 14, 2014

Ok, it's here: #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants