id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12243,Boost.Serialization compilation error in Visual Studio with Zc:wchar_t-,anonymous,Robert Ramey,"The error is following: {{{ C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\limits(85) : error C2090: function returns array H:\Third_party_src\boost\boost_1_61_0-compiled\boost/archive/basic_text_oprimitive.hpp(147) : see reference to class template instantiation 'std::numeric_limits<_Ty>' being compiled with [ _Ty=const unsigned short [24] ] H:\Third_party_src\boost\boost_1_61_0-compiled\boost/archive/basic_text_oprimitive.hpp(180) : see reference to class template instantiation 'boost::archive::basic_text_oprimitive::is_float' being compiled with [ OStream=std::wostream, T=const unsigned short [24] ] H:\Third_party_src\boost\boost_1_61_0-compiled\boost/archive/xml_woarchive.hpp(73) : see reference to function template instantiation 'void boost::archive::basic_text_oprimitive::save(T (&))' being compiled with [ OStream=std::wostream, T=const unsigned short [24] ] H:\Third_party_src\boost\boost_1_61_0-compiled\boost/archive/xml_woarchive.hpp(73) : see reference to function template instantiation 'void boost::archive::basic_text_oprimitive::save(T (&))' being compiled with [ OStream=std::wostream, T=const unsigned short [24] ] H:\Third_party_src\boost\boost_1_61_0-compiled\boost/archive/impl/xml_woarchive_impl.ipp(144) : see reference to function template instantiation 'void boost::archive::xml_woarchive_impl::save(T (&))' being compiled with [ Archive=boost::archive::xml_woarchive, T=const unsigned short [24] ] ............................... }}} The problem is with '''boost/archive/impl/xml_woarchive_impl.ipp(144)''' line: {{{ save(L""\n""); }}} It's fixed by replacing line with {{{ save((const wchar_t*)L""\n""); }}} Interesting error, as it treats the literal L""\n"" as 'const unsigned short [24]' and picks {{{ template void save(const T & t){ basic_text_oprimitive::save(t); } }}} from '''boost/archive/xml_woarchive.hpp''' , instead of correct {{{ #ifndef BOOST_NO_INTRINSIC_WCHAR_T BOOST_WARCHIVE_DECL void save(const wchar_t * t); #endif }}} And... If we remove the {{{ #ifndef BOOST_NO_INTRINSIC_WCHAR_T }}} everything (including /Zc:wchar_t and /Zc:wchar_t- configurations) compiles fine. '''So the actual bug is this 'ifndef'.''' Why it was placed here? Most likely by mistake. Please remove this 'ifndef'. ",Bugs,new,To Be Determined,serialization,Boost 1.61.0,Showstopper,,,