msgpack-c icon indicating copy to clipboard operation
msgpack-c copied to clipboard

compilation error on clang++ with -std=c++11

Open idkiller opened this issue 11 years ago • 2 comments

I got an error when using it with c++11 and clang++ 3.2.

../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:73:35: error: reference to 'base' is ambiguous
        typename tuple_element<I, base >::type&
                                  ^
../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:47:21: note: candidate found by name lookup is 'msgpack::v1::type::tuple::base'
        using base::base;
                    ^
../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:45:15: note: candidate found by name lookup is 'msgpack::v1::type::tuple::base'
        using base = std::tuple<Types...>;
              ^
../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:73:35: error: reference to 'base' is ambiguous
        typename tuple_element<I, base >::type&
                                  ^
../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:47:21: note: candidate found by name lookup is 'msgpack::v1::type::tuple::base'
        using base::base;
                    ^
../external/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp:45:15: note: candidate found by name lookup is 'msgpack::v1::type::tuple::base'
        using base = std::tuple<Types...>;

I resolve it with simply replacing the base to another name.

idkiller avatar Mar 28 '15 07:03 idkiller

Thank you for reporting the issue.

The following code is an inheriting constructor:

  using base::base;

And it has been supported since clang 3.3.

See http://clang.llvm.org/cxx_status.html

The C++11 version of msgpack-c requires C++ full support, basically.Could you use clang++ 3.3 or later when you use msgpack-c with C++11?

I resolve it with simply replacing the base to another name.

I'm not sure why, but maybe inheriting constructors are not introduced.

redboltz avatar Mar 29 '15 08:03 redboltz

I will close this issue. If @idkiller has additional comments, please let me know.

redboltz avatar Jun 01 '15 00:06 redboltz