Opened 12 years ago
Closed 12 years ago
#4199 closed Patches (fixed)
Sun Studio compilation of sp_typeinfo.hpp
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | Boost 1.44.0 | Component: | smart_ptr |
Version: | Boost Development Trunk | Severity: | Showstopper |
Keywords: | SunPro, sp_typeinfo, Sun Studio | Cc: |
Description
The Sun Studio compiler gets confused about static initialization constructor arguments. But an assignment works just fine.
Observed in boost 1.42.0, same code in trunk and 1.43.0.
Using flags: BOOST_CXXFLAGS += -DBOOST_NO_IOSTREAM=1 BOOST_CXXFLAGS += -DBOOST_NO_TYPEID=1 BOOST_CXXFLAGS += -DBOOST_NO_RTTI=1 BOOST_CXXFLAGS += -DBOOST_SP_DISABLE_THREADS=1 BOOST_CXXFLAGS += -DBOOST_NO_EXCEPTIONS=1 BOOST_CXXFLAGS += -DBOOST_PTR_CONTAINER_NO_EXCEPTIONS=1 BOOST_CXXFLAGS += -DBOOST_REGEX_NO_LIB=1 BOOST_CXXFLAGS += -DBOOST_REGEX_NO_W32=1 BOOST_CXXFLAGS += -DBOOST_REGEX_NON_RECURSIVE=1 BOOST_CXXFLAGS += -DBOOST_REGEX_NO_EXTERNAL_TEMPLATES=1 BOOST_CXXFLAGS += -DBOOST_NO_WREGEX=1 BOOST_CXXFLAGS += -DBOOST_ALL_NO_LIB=1
Attachments (1)
Change History (8)
by , 12 years ago
Attachment: | boost_detail_typeinfo_SunPro.diff added |
---|
comment:1 by , 12 years ago
Component: | None → smart_ptr |
---|---|
Owner: | set to |
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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
comment:5 by , 12 years ago
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Patch for boost/detail/sp_typeinfo.hpp