Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4199: Sun Studio compilation of sp_typeinfo.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-29 10:04:33
#4199: Sun Studio compilation of sp_typeinfo.hpp
--------------------------------------+-------------------------------------
Reporter: nstewart@⦠| Owner: pdimov
Type: Patches | Status: reopened
Milestone: Boost 1.44.0 | Component: smart_ptr
Version: Boost Development Trunk | Severity: Showstopper
Resolution: | Keywords: SunPro,sp_typeinfo,Sun Studio
--------------------------------------+-------------------------------------
Changes (by tobias.loew):
* status: closed => reopened
* resolution: fixed =>
Comment:
After the change the following code doesn't compile anymore on my VC 9
compiler:
{{{
#define BOOST_NO_TYPEID
#include <boost/smart_ptr.hpp>
#include <boost/make_shared.hpp>
struct test {
test(){}
int i;
};
int main(int argc, char* argv[])
{
boost::shared_ptr<test> spt = boost::make_shared<test>();
return 0;
}
}}}
the error message is:
boost/detail/sp_typeinfo.hpp(77) : error C2440: 'Initialisierung': 'const
char *' kann nicht in 'boost::detail::sp_typeinfo' konvertiert werden
(in english: 'const char *' cannot be converted to
'boost::detail::sp_typeinfo')
Before the change the line in sp_typeinfo.hpp(77) was:
template<class T> sp_typeinfo sp_typeid< T >::ti_( sp_typeid< T >::name()
);
so, the explicit-marked ctor was called.
Afterwards it changed to
template<class T> sp_typeinfo sp_typeid< T >::ti_ = sp_typeid< T
>::name();
so the with "explicit" marked ctor of sp_typeid< T > can't be called
anymore.
I suggest protecting the change with some compiler/platform-detection
macro for the Sun Studio
Tobias
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4199#comment:4> 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:04 UTC