[Boost-bugs] [Boost C++ Libraries] #12243: Boost.Serialization compilation error in Visual Studio with Zc:wchar_t-

Subject: [Boost-bugs] [Boost C++ Libraries] #12243: Boost.Serialization compilation error in Visual Studio with Zc:wchar_t-
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-01 15:30:09


#12243: Boost.Serialization compilation error in Visual Studio with Zc:wchar_t-
-------------------------+------------------------------
 Reporter: anonymous | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.61.0
 Severity: Showstopper | Keywords:
-------------------------+------------------------------
 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<OStream>::is_float<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<OStream>::save<const unsigned
 short[24]>(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<OStream>::save<const unsigned
 short[24]>(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<Archive>::save<const unsigned
 short[24]>(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"</boost_serialization>\n");
 }}}
 It's fixed by replacing line with
 {{{
         save((const wchar_t*)L"</boost_serialization>\n");
 }}}

 Interesting error, as it treats the literal L"</boost_serialization>\n" as
 'const unsigned short [24]' and picks
 {{{
 template<class T>
     void
     save(const T & t){
         basic_text_oprimitive<std::wostream>::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'.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12243>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC