Boost C++ Libraries: Ticket #4199: Sun Studio compilation of sp_typeinfo.hpp https://svn.boost.org/trac10/ticket/4199 <p> The Sun Studio compiler gets confused about static initialization constructor arguments. But an assignment works just fine. </p> <p> Observed in boost 1.42.0, same code in trunk and 1.43.0. </p> <p> 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 </p> <p> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4199 Trac 1.4.3 nstewart@… Fri, 07 May 2010 20:18:19 GMT attachment set https://svn.boost.org/trac10/ticket/4199 https://svn.boost.org/trac10/ticket/4199 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_detail_typeinfo_SunPro.diff</span> </li> </ul> <p> Patch for boost/detail/sp_typeinfo.hpp </p> Ticket Steven Watanabe Sat, 08 May 2010 18:29:00 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4199#comment:1 https://svn.boost.org/trac10/ticket/4199#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> Ticket Peter Dimov Wed, 26 May 2010 17:44:00 GMT <link>https://svn.boost.org/trac10/ticket/4199#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4199#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62245" title="Applied patch for Sun C++. Refs #4199.">[62245]</a>) Applied patch for Sun C++. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4199" title="#4199: Patches: Sun Studio compilation of sp_typeinfo.hpp (closed: fixed)">#4199</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 10 Jul 2010 20:46:55 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4199#comment:3 https://svn.boost.org/trac10/ticket/4199#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/63825" title="Merge [62245] to release. Fixes #4199.">[63825]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/62245" title="Applied patch for Sun C++. Refs #4199.">[62245]</a> to release. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4199" title="#4199: Patches: Sun Studio compilation of sp_typeinfo.hpp (closed: fixed)">#4199</a>. </p> Ticket Tobias Loew Sun, 29 Aug 2010 10:04:33 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4199#comment:4 https://svn.boost.org/trac10/ticket/4199#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> After the change the following code doesn't compile anymore on my VC 9 compiler: </p> <pre class="wiki">#define BOOST_NO_TYPEID #include &lt;boost/smart_ptr.hpp&gt; #include &lt;boost/make_shared.hpp&gt; struct test { test(){} int i; }; int main(int argc, char* argv[]) { boost::shared_ptr&lt;test&gt; spt = boost::make_shared&lt;test&gt;(); return 0; } </pre><p> 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') </p> <p> Before the change the line in sp_typeinfo.hpp(77) was: </p> <p> template&lt;class T&gt; sp_typeinfo sp_typeid&lt; T &gt;::ti_( sp_typeid&lt; T &gt;::name() ); </p> <p> so, the explicit-marked ctor was called. Afterwards it changed to </p> <p> template&lt;class T&gt; sp_typeinfo sp_typeid&lt; T &gt;::ti_ = sp_typeid&lt; T &gt;::name(); </p> <p> so the with "explicit" marked ctor of sp_typeid&lt; T &gt; can't be called anymore. </p> <p> I suggest protecting the change with some compiler/platform-detection macro for the Sun Studio </p> <p> Tobias </p> Ticket nstewart@… Tue, 31 Aug 2010 15:50:47 GMT <link>https://svn.boost.org/trac10/ticket/4199#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4199#comment:5</guid> <description> <p> The appropriate check for the <a class="missing wiki">SunPro</a> compiler would be: <span class="underline">SUNPRO_CC But I suspect that <a class="missing wiki">SunPro</a> is right, and MSVC is wrong. :-) </span></p> <ul><li>Nigel </li></ul> </description> <category>Ticket</category> </item> <item> <author>nstewart@…</author> <pubDate>Tue, 31 Aug 2010 15:51:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4199#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4199#comment:6</guid> <description> <p> Oops, make that </p> <pre class="wiki">__SUNPRO_CC </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Fri, 24 Dec 2010 02:47:10 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4199#comment:7 https://svn.boost.org/trac10/ticket/4199#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This was fixed with <a class="changeset" href="https://svn.boost.org/trac10/changeset/66031" title="Fixing sp_typeinfo for clang and gcc 4.5.1">[66031]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/66091" title="Re-added sunpro specific initialization">[66091]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/66166" title="Merging from trunk">[66166]</a>. </p> Ticket