Boost C++ Libraries: Ticket #9441: SolarisStudio support https://svn.boost.org/trac10/ticket/9441 <p> Hi </p> <p> The attached patch makes TTI work better with the "Sun" compiler (5.12). It reduces the test fails from 31 to 10, though of the failures that remain some seem to be caused by mysterious whitespace removal: </p> <pre class="wiki">"test_vm_has_template_cp.hpp", line 24: Error: Expected "class" or "struct" before "classATemplate" </pre><p> Setting BOOST_PP_VARIADIC=0 for all tests drop the failures to 8. </p> <p> Of the remaining failures, most (all I think) seem to be caused by has_template. </p> <p> Sadly I can't see a simple declaration-only sfinae helper struct in the template introspection code that could have the same mod applied to it, but given the BOOST_PP maybe I've missed it :) I'll have a play when I get some time, or if there's a simple non-BOOST_PP full example I'm happy to try to get that to work. In the meantime, I've attached the output of the remaining failures in case it's of any interest. </p> <p> All tests still pass with gcc 4.8 on Linux. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9441 Trac 1.4.3 anonymous Wed, 27 Nov 2013 18:41:19 GMT attachment set https://svn.boost.org/trac10/ticket/9441 https://svn.boost.org/trac10/ticket/9441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tti-sun.patch</span> </li> </ul> <p> Sun patches </p> Ticket anonymous Wed, 27 Nov 2013 18:41:42 GMT attachment set https://svn.boost.org/trac10/ticket/9441 https://svn.boost.org/trac10/ticket/9441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test-output.txt</span> </li> </ul> <p> test failures </p> Ticket lukester_null@… Fri, 29 Nov 2013 11:19:45 GMT <link>https://svn.boost.org/trac10/ticket/9441#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:1</guid> <description> <p> OK so I had a play around with has_template_xxx with the Sun compiler. </p> <p> BOOST_TTI_HAS_TEMPLATE(<a class="missing wiki">InnerTemplate</a>, (1,(typename))) </p> <p> Generates: </p> <pre class="wiki">template &lt; typename BOOST_TTI_DETAIL_TP_T, typename BOOST_TTI_DETAIL_TP_FALLBACK_ = Boost::mpl::bool_&lt; false &gt; &gt; class has_template_InnerTemplate_detail { template&lt; typename U &gt; struct has_template_InnerTemplate_detail_introspect { template &lt; template &lt; typename &gt; class BOOST_TTI_DETAIL_TM_V &gt; struct has_template_InnerTemplate_detail_substitute0 { }; template&lt; typename V &gt; static Boost::mpl::aux::no_tag has_template_InnerTemplate_detail_test(...); template&lt; typename V &gt; static Boost::mpl::aux::yes_tag has_template_InnerTemplate_detail_test( Boost::mpl::aux::type_wrapper&lt; V &gt; const volatile* , has_template_InnerTemplate_detail_substitute0 &lt; V::template InnerTemplate &gt; * = 0 ); static const bool value = sizeof(has_template_InnerTemplate_detail_test&lt; U &gt;(0)) == sizeof(Boost::mpl::aux::yes_tag); typedef Boost::mpl::bool_&lt; value &gt; type; }; public: static const bool value = has_template_InnerTemplate_detail_introspect&lt; BOOST_TTI_DETAIL_TP_T &gt;::value; typedef typename has_template_InnerTemplate_detail_introspect &lt; BOOST_TTI_DETAIL_TP_T &gt;::type type; }; template&lt;class BOOST_TTI_DETAIL_TP_T&gt; struct has_template_InnerTemplate : has_template_InnerTemplate_detail&lt;BOOST_TTI_DETAIL_TP_T&gt; { }; </pre><p> Two tweaks make this work: </p> <ul><li>Using a nested type typedef within the substitute class (and appropriate change for the "yes" test function). Not unreasonable for any compiler I'd have thought. </li><li>In the "yes" test function, using "U template::&lt;template name&gt;" rather than "V template::&lt;template name&gt;". This is obviously horribly broken on a non-broken compiler but seems to do the trick here... </li></ul><p> Something like: </p> <pre class="wiki">template &lt; typename BOOST_TTI_DETAIL_TP_T, typename BOOST_TTI_DETAIL_TP_FALLBACK_ = Boost::mpl::bool_&lt; false &gt; &gt; class has_template_InnerTemplate_detail { template&lt; typename U &gt; struct has_template_InnerTemplate_detail_introspect { template &lt; template &lt; typename &gt; class BOOST_TTI_DETAIL_TM_V &gt; struct has_template_InnerTemplate_detail_substitute0 { typedef void type; }; template&lt; typename V &gt; static Boost::mpl::aux::no_tag has_template_InnerTemplate_detail_test(...); template&lt; typename V &gt; static Boost::mpl::aux::yes_tag has_template_InnerTemplate_detail_test( Boost::mpl::aux::type_wrapper&lt; V &gt; const volatile* , typename has_template_InnerTemplate_detail_substitute0 &lt; U::template InnerTemplate &gt;::type* = 0 ); static const bool value = sizeof(has_template_InnerTemplate_detail_test&lt; U &gt;(0)) == sizeof(Boost::mpl::aux::yes_tag); typedef Boost::mpl::bool_&lt; value &gt; type; }; public: static const bool value = has_template_InnerTemplate_detail_introspect&lt; BOOST_TTI_DETAIL_TP_T &gt;::value; typedef typename has_template_InnerTemplate_detail_introspect &lt; BOOST_TTI_DETAIL_TP_T &gt;::type type; }; template&lt;class BOOST_TTI_DETAIL_TP_T&gt; struct has_template_InnerTemplate : has_template_InnerTemplate_detail&lt;BOOST_TTI_DETAIL_TP_T&gt; { }; </pre><p> I'll attach a patch (dtemplate_params.patch) that applies the above for the specific parameters case, since it's pretty easy to localize it to just that file (though not necessarily the "right" thing to do). The BOOST_PP_NIL case is a bit more of a problem as it's mostly mpl's has_xxx.hpp. I'll attach a patch for that also. </p> <p> Tests still fail as the BOOST_PP_NIL usage with non-class template parameters actually works. I.e. </p> <pre class="wiki">#include "boost/tti/has_template.hpp" #include "boost/static_assert.hpp" class Test { public: template&lt;typename T&gt; class InnerTTemplate { }; template&lt;int C&gt; class InnerITemplate { }; }; class Test2 { }; namespace Nil { BOOST_TTI_HAS_TEMPLATE(InnerTTemplate, BOOST_PP_NIL) BOOST_TTI_HAS_TEMPLATE(InnerITemplate, BOOST_PP_NIL) BOOST_STATIC_ASSERT((has_template_InnerTTemplate&lt;Test&gt;::value)); BOOST_STATIC_ASSERT((has_template_InnerITemplate&lt;Test&gt;::value)); BOOST_STATIC_ASSERT((!has_template_InnerTTemplate&lt;Test2&gt;::value)); BOOST_STATIC_ASSERT((!has_template_InnerITemplate&lt;Test2&gt;::value)); } namespace Spec { BOOST_TTI_HAS_TEMPLATE(InnerTTemplate, (1,(typename))) BOOST_TTI_HAS_TEMPLATE(InnerITemplate, (1,(int))) BOOST_STATIC_ASSERT((has_template_InnerTTemplate&lt;Test&gt;::value)); BOOST_STATIC_ASSERT((has_template_InnerITemplate&lt;Test&gt;::value)); BOOST_STATIC_ASSERT((!has_template_InnerTTemplate&lt;Test2&gt;::value)); BOOST_STATIC_ASSERT((!has_template_InnerITemplate&lt;Test2&gt;::value)); } int main() { return 0; } </pre><p> builds. </p> <p> Anyway, I hope this is of some use, though it seems more of an mpl ticket at this point... </p> <p> Regards </p> <p> Luke Elliott. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 29 Nov 2013 11:20:41 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/9441 https://svn.boost.org/trac10/ticket/9441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">dtemplate_params.patch</span> </li> </ul> <p> Hacks to dtemplate_params.hpp to allow specific parameters usage to work with Sun compiler. </p> Ticket anonymous Fri, 29 Nov 2013 11:21:13 GMT attachment set https://svn.boost.org/trac10/ticket/9441 https://svn.boost.org/trac10/ticket/9441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">has_xxx.patch</span> </li> </ul> <p> Hacks to mpl's has_xxx.hpp to allow BOOST_PP_NIL has_template_xxx to work with Sun compiler. </p> Ticket anonymous Fri, 29 Nov 2013 11:25:22 GMT attachment set https://svn.boost.org/trac10/ticket/9441 https://svn.boost.org/trac10/ticket/9441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">has_xxx.2.patch</span> </li> </ul> <p> Whoops, missing ; in the first patch. </p> Ticket Edward Diener Mon, 09 Dec 2013 15:59:32 GMT <link>https://svn.boost.org/trac10/ticket/9441#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:2</guid> <description> <p> A fix for the bug in Boost MPL has been pushed to a separate git repository forked from the MPL 'develop' branch. The repository address is <a class="ext-link" href="https://github.com/eldiener/mplsun.git"><span class="icon">​</span>https://github.com/eldiener/mplsun.git</a>. I will try to test this on Linux but I am not sure I have the correct Sun C++ compiler there to test it. If anybody can test this change for Sun CC for Boost MPL it will be appreciated. In the test, if the fix supplied is correct, there should be no errors when the Boost MPL has_xxx test is run using Sun CC with the fix in place if the fix supplied is correct. </p> <p> I also modified the fix in has_xxx.2.patch, as applied to Boost MPL has_xxx.hpp so only code for Sun CC is changed. I was not about to change any of the other has_xxx.hpp code for any other compiler. </p> <p> I will work on the fix for TTI next, but I would like to ascertain that the fix for Boost MPL has_xxx.hpp works correctly for Sun CC. This is because for BOOST_TTI_HAS_TYPE and the simpler cases of BOOST_TTI_HAS_TEMPLATE it uses the has_xxx implementation of Boost MPL internally. </p> </description> <category>Ticket</category> </item> <item> <author>lukester_null@…</author> <pubDate>Tue, 10 Dec 2013 11:41:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:3</guid> <description> <p> Hi </p> <p> No luck I'm afraid with the has_xxx test - it seems to get confused by the presence of something other than a template with the given name, and also </p> <pre class="wiki">// agurt, 15/aug/04: make sure MWCW passes the test in presence of the following // template template&lt; typename T &gt; struct xxx; </pre><p> Removing that leaves failures for </p> <p> MPL_ASSERT_NOT(( has_xxx_template&lt;a2&gt; )); </p> <p> MPL_ASSERT_NOT(( has_xxx_template&lt;a3&gt; )); </p> <p> MPL_ASSERT_NOT(( has_xxx_template&lt;a4&gt; )); </p> <p> and all the b2 tests. </p> <p> Compiler too broken, I guess. Not sure if I'll get any more time to hack around, but if I do I'll post back anything I find. (For me right now the first patch with the member function introspection fixes etc. is all I need...) </p> <p> Thanks </p> <p> Luke. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Thu, 12 Dec 2013 17:05:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:4</guid> <description> <p> I have pushed the Boost MPL fix to MPL on modular-boost now that I have write access to Boost MPL. It is on a branch of Boost MPL called 'mplsun'. I have also pushed the Boost TTI fixes to TTI on modular-boost in a branch of TTI called 'ttisun'. if anybody can test these changes for the Sun compiler on Linux that would be appreciated. The TTI change has the member function introspection fixes for the Sun compiler so hopefully that will be fixed. The issues with BOOST_TTI_HAS_TEMPLATE will probably not work since it relies on the MPL implementation, but can at least be tested. I will try to find some time to report the BOOST_TTI_HAS_TEMPLATE issues for the Sun compiler to Oracle. Perhaps they can upgrade the compiler in the future so that this MPL functionality, and the corresponding TTI functionality, will work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sun, 22 Dec 2013 01:31:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:5</guid> <description> <p> I have tested the fixes with the Solaris Studio 12.3 product. The fixes fix all bugs except for the BOOST_TTI_HAS_TEMPLATE problem and the corresponding problem with the Boost MPL BOOST_MPL_HAS_XXX_TEMPLATE_DEF/BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF macros. I have inquired how I report this problem to Oracle, and will do so if I am able. I will merge the changes into the TTI developer branch shortly and 'push' those changes to the Boost repository on Github. They will be in the next release of Boost and, depending on where Boost id going with git, I may put out a separate release of TTI with these changes also. </p> <p> I am pretty sure that until Oracle fixes the compiler problem that the HAS_TEMPLATE problem in MPL and TTI with the Sun compiler it will not be fixed. But if anyone has a viable workaround for that problem I will be glad to incorporate it in both MPL and TTI. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sat, 28 Dec 2013 00:25:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:6</guid> <description> <p> The fixes for the Sun compiler have now been merged into the 'develop' branch of tti in the modular-boost setup. I will merge them to release for the next version of Boost. </p> <p> I reported the problems with template introspection in mpl and tti to Oracle on their C++ forum. It is now up to them to decide if they are going to fix these problems. </p> <p> The rest of tti, outside of the class template introspection, should now work with the Sun compiler using the 'develop' branch of modular-boost. </p> </description> <category>Ticket</category> </item> <item> <author>Fedor Sergeev <Fedor.Sergeev@…></author> <pubDate>Tue, 18 Mar 2014 18:46:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:7</guid> <description> <p> I have just replied to your Oracle forums post (<a class="ext-link" href="https://community.oracle.com/thread/2615211"><span class="icon">​</span>https://community.oracle.com/thread/2615211</a>). The testcases you submitted there seem to be invalid to me. </p> <p> Can you, please, check it out and verify that your SunC++ solution is appropriate? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 21 Jul 2014 13:48:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9441#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9441#comment:8</guid> <description> <p> The fix was merged into the master branch in late February and will go into Boost 1.56. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 21 Jul 2014 13:50:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9441#comment:9 https://svn.boost.org/trac10/ticket/9441#comment:9 <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> Ticket