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

fails to compile with clang #5

Closed
bodomartin opened this issue Feb 26, 2017 · 4 comments
Closed

fails to compile with clang #5

bodomartin opened this issue Feb 26, 2017 · 4 comments

Comments

@bodomartin
Copy link

clang (3.9.1) , boost 1.62 , complains about ctype in libc++ ,and in the json vector serialization. I have been trying to fix these but no success for far :-|

@breese
Copy link
Owner

breese commented Feb 26, 2017

Can you show some of the compilation errors?

I just pushed a fix for compilation against boost 1.62 (or more accurately the boost develop branch.) This was not about ctype though.

@bodomartin
Copy link
Author

Hi,

sure,

for ctype:

In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/encoder_suite.cpp:11:
In file included from /usr/bin/../include/c++/v1/sstream:174:
In file included from /usr/bin/../include/c++/v1/ostream:138:
/usr/bin/../include/c++/v1/ios:739:50: error: implicit instantiation of undefined template 'std::__1::ctype'
return use_facet<ctype<char_type> >(getloc()).widen(__c);
^
/usr/bin/../include/c++/v1/ios:748:19: note: in instantiation of member function 'std::__1::basic_ios<unsigned char,
std::__1::char_traits >::widen' requested here
_fill = widen(' ');
^
/usr/bin/../include/c++/v1/ostream:762:39: note: in instantiation of member function 'std::__1::basic_ios<unsigned char,
std::__1::char_traits >::fill' requested here
__os.fill()).failed())
^
/usr/bin/../include/c++/v1/ostream:780:19: note: in instantiation of function template specialization
'std::__1::__put_character_sequence<unsigned char, std::__1::char_traits >' requested here
return _VSTD::__put_character_sequence(__os, &__c, 1);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/buffer/ostream.hpp:43:17: note: in instantiation of
function template specialization 'std::__1::operator<<<unsigned char, std::__1::char_traits >' requested here
content << value;
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/buffer/ostream.hpp:33:5: note: in instantiation of
member function 'trial::protocol::buffer::basic_ostream<unsigned char, trial::protocol::buffer::base >::write'
requested here
basic_ostream(std::basic_ostream& stream) : content(stream) {}
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/detail/encoder.ipp:205:18: note: in instantiation
of member function 'trial::protocol::buffer::basic_ostream<unsigned char, trial::protocol::buffer::base
>::basic_ostream' requested here
: buffer(new typename buffer::traits::buffer_type(output))
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/encoder_suite.cpp:378:27: note: in instantiation of function template
specialization 'trial::protocol::json::detail::basic_encoder::basic_encoder<std::__1::basic_ostringstream<unsigned
char, std::__1::char_traits, std::__1::allocator > >' requested here
unsigned_encoder_type encoder(buffer);
^
/usr/bin/../include/c++/v1/__locale:429:53: note: template is declared here
template class _LIBCPP_TYPE_VIS_ONLY ctype;
^
/usr/bin/../include/c++/v1/__locale:188:54: error: implicit instantiation of undefined template 'std::__1::ctype'
return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
^
/usr/bin/../include/c++/v1/ios:739:12: note: in instantiation of function template specialization
'std::__1::use_facet<std::__1::ctype >' requested here
return use_facet<ctype<char_type> >(getloc()).widen(__c);
^
/usr/bin/../include/c++/v1/ios:748:19: note: in instantiation of member function 'std::__1::basic_ios<unsigned char,
std::__1::char_traits >::widen' requested here
_fill = widen(' ');
^
/usr/bin/../include/c++/v1/ostream:762:39: note: in instantiation of member function 'std::__1::basic_ios<unsigned char,
std::__1::char_traits >::fill' requested here
__os.fill()).failed())
^
/usr/bin/../include/c++/v1/ostream:780:19: note: in instantiation of function template specialization
'std::__1::__put_character_sequence<unsigned char, std::__1::char_traits >' requested here
return _VSTD::__put_character_sequence(__os, &__c, 1);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/buffer/ostream.hpp:43:17: note: in instantiation of
function template specialization 'std::__1::operator<<<unsigned char, std::__1::char_traits >' requested here
content << value;
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/buffer/ostream.hpp:33:5: note: in instantiation of
member function 'trial::protocol::buffer::basic_ostream<unsigned char, trial::protocol::buffer::base >::write'
requested here
basic_ostream(std::basic_ostream& stream) : content(stream) {}
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/detail/encoder.ipp:205:18: note: in instantiation
of member function 'trial::protocol::buffer::basic_ostream<unsigned char, trial::protocol::buffer::base
>::basic_ostream' requested here
: buffer(new typename buffer::traits::buffer_type(output))
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/encoder_suite.cpp:378:27: note: in instantiation of function template
specialization 'trial::protocol::json::detail::basic_encoder::basic_encoder<std::__1::basic_ostringstream<unsigned
char, std::__1::char_traits, std::__1::allocator > >' requested here
unsigned_encoder_type encoder(buffer);
^
/usr/bin/../include/c++/v1/__locale:429:53: note: template is declared here
template class _LIBCPP_TYPE_VIS_ONLY ctype;


for json vector :

In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/oarchive_suite.cpp:14:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization.hpp:14:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/serialization.hpp:16:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/oarchive.hpp:15:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/common_oarchive.hpp:22:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/interface_oarchive.hpp:23:
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:255:17: error: no viable conversion from
'__bit_iterator<std::__1::vector<bool, std::__1::allocator >, true>' to 'const void *'
& t,
^~~
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:309:16: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::save_standard::invoke<std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > >' requested here
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:526:12: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::invoke<std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > >' requested here
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/detail/oarchive.ipp:48:21: note: in
instantiation of function template specialization 'boost::archive::save<trial::protocol::json::basic_oarchive, const
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > >' requested here
boost::archive::save(*this, data);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/std/vector.hpp:37:21: note: in
instantiation of function template specialization
'trial::protocol::json::basic_oarchive::save_override<std::__1::__bit_const_reference<std::__1::vector<bool,
std::__1::allocator > > >' requested here
archive.save_override(*it);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/serialization.hpp:113:75: note: in
instantiation of member function 'trial::protocol::serialization::save_overloader<trial::protocol::json::basic_oarchive,
std::__1::vector<bool, std::__1::allocator >, void>::save' requested here
save_overloader<trial::protocol::json::basic_oarchive, Value>::save(ar, data, version);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/serialization/split_free.hpp:45:9: note: (skipping 9 contexts in backtrace; use
-ftemplate-backtrace-limit=0 to see all)
save(ar, t, v);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:309:16: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::save_standard::invoke<std::__1::vector<bool, std::__1::allocator > >' requested here
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:526:12: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::invoke<std::__1::vector<bool, std::__1::allocator > >' requested here
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/detail/oarchive.ipp:48:21: note: in
instantiation of function template specialization 'boost::archive::save<trial::protocol::json::basic_oarchive, const
std::__1::vector<bool, std::__1::allocator > >' requested here
boost::archive::save(*this, data);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/interface_oarchive.hpp:70:23: note: in instantiation of function
template specialization 'trial::protocol::json::basic_oarchive::save_override<std::__1::vector<bool, std::__1::allocator
> >' requested here
this->This()->save_override(t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/oarchive_suite.cpp:410:8: note: in instantiation of function template
specialization 'boost::archive::detail::interface_oarchive<trial::protocol::json::basic_oarchive
>::operator<<<std::__1::vector<bool, std::__1::allocator > >' requested here
ar << value;
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/basic_oarchive.hpp:72:21: note: passing argument to parameter 'x'
here
const void *x,


and for serialize_overloader

In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/oarchive_suite.cpp:14:
In file included from /nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization.hpp:14:
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/serialization.hpp:134:80: error: no
member named 'serialize' in 'trial::protocol::serialization::serialize_overloader<trial::protocol::json::basic_oarchive,
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > >, void>'
serialize_overloader<trial::protocol::json::basic_oarchive, Value>::serialize(ar, data, version);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/serialization/serialization.hpp:126:5: note: in instantiation of function
template specialization 'boost::serialization::serialize<char, std::__1::__bit_const_reference<std::__1::vector<bool,
std::__1::allocator > > >' requested here
serialize(ar, t, v);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:149:27: note: in instantiation of function
template specialization 'boost::serialization::serialize_adl<trial::protocol::json::basic_oarchive,
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > >' requested here
boost::serialization::serialize_adl(
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/serialization/singleton.hpp:122:47: note: in instantiation of member function
'boost::archive::detail::oserializer<trial::protocol::json::basic_oarchive,
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > >::save_object_data' requested here
static detail::singleton_wrapper< T > t;
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/serialization/singleton.hpp:135:16: note: in instantiation of member function
'boost::serialization::singleton<boost::archive::detail::oserializer<trial::protocol::json::basic_oarchive,
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > > >::get_instance' requested here
return get_instance();
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:258:20: note: in instantiation of member function
'boost::serialization::singleton<boost::archive::detail::oserializer<trial::protocol::json::basic_oarchive,
std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator > > > >::get_const_instance' requested here
>::get_const_instance()
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:309:16: note: (skipping 14 contexts in backtrace;
use -ftemplate-backtrace-limit=0 to see all)
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:309:16: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::save_standard::invoke<std::__1::vector<bool, std::__1::allocator > >' requested here
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/oserializer.hpp:526:12: note: in instantiation of function
template specialization 'boost::archive::detail::save_non_pointer_type<trial::protocol::json::basic_oarchive
>::invoke<std::__1::vector<bool, std::__1::allocator > >' requested here
typex::invoke(ar, t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/include/trial/protocol/json/serialization/detail/oarchive.ipp:48:21: note: in
instantiation of function template specialization 'boost::archive::save<trial::protocol::json::basic_oarchive, const
std::__1::vector<bool, std::__1::allocator > >' requested here
boost::archive::save(*this, data);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/usr/include/boost/archive/detail/interface_oarchive.hpp:70:23: note: in instantiation of function
template specialization 'trial::protocol::json::basic_oarchive::save_override<std::__1::vector<bool, std::__1::allocator
> >' requested here
this->This()->save_override(t);
^
/nvme/momec/c1/b/l/x86-64/c/3.9.1/A/RelW/ext/trial_protocol/test/json/oarchive_suite.cpp:410:8: note: in instantiation of function template
specialization 'boost::archive::detail::interface_oarchive<trial::protocol::json::basic_oarchive
>::operator<<<std::__1::vector<bool, std::__1::allocator > >' requested here
ar << value;

Thanks for looking into this

@breese
Copy link
Owner

breese commented Feb 26, 2017

The ctype problem is probably caused by the use of unsigned char. I suspect that I need to define a char_traits for unsigned char (that could also replace my workaround in json/detail/to_string.hpp.) However, I need to find a way to reproduce the problem locally first (installing the libc++ package caused unrelated problems.)

The serialization problems are most likely caused by the test suite that uses std::vector<bool>. I have pushed a commit that uses std::vector<int> instead. I will looked into the problem with std::vector<bool> later.

@breese
Copy link
Owner

breese commented Feb 28, 2017

Should be fixed on develop now.

@breese breese closed this as completed Feb 28, 2017
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