Boost C++ Libraries: Ticket #11606: Compile errors with Clang 3.7 (and earlier) https://svn.boost.org/trac10/ticket/11606 <p> The problem is complicated and most probably belongs to <strong>Boost.Fusion</strong>. However I'm not very sure, and technically all tests from fusion compile, it's the test from spirit repository fails. So, I'm posting it under the spirit component. </p> <p> The spirit/repository/test/qi/keywords.cpp does not compile with recent clang@apple with default preprocessor definitions. I'm attaching the compiler log with this ticket. </p> <p> The only way I can compile it is to use <strong>BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK</strong> preprocessor flag, unfortunately with flags triggers another branch of compile errors related to <strong>fusion's result_of</strong> helper. To fix <strong>BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK</strong> compile errors the file boost/fusion/support/detail/result_of.hpp should be modified as follows: </p> <p> Was: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)</span> </pre></div></div><p> Should: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#if 1 || (!defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) \</span> <span class="cp"> &amp;&amp; !defined(BOOST_RESULT_OF_USE_DECLTYPE)) \</span> <span class="cp"> || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)</span> </pre></div></div><p> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11606 Trac 1.4.3 Nikki Chumakov <nikkikom@…> Mon, 31 Aug 2015 22:26:42 GMT attachment set https://svn.boost.org/trac10/ticket/11606 https://svn.boost.org/trac10/ticket/11606 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">compile-log.txt</span> </li> </ul> <p> Compile log </p> Ticket Nikki Chumakov <nikkikom@…> Mon, 31 Aug 2015 22:27:05 GMT attachment set https://svn.boost.org/trac10/ticket/11606 https://svn.boost.org/trac10/ticket/11606 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">clang-version.txt</span> </li> </ul> <p> Clang version </p> Ticket Nikki Chumakov <nikkikom@…> Mon, 31 Aug 2015 22:32:55 GMT <link>https://svn.boost.org/trac10/ticket/11606#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:1</guid> <description> <p> Sorry, was wrong correction line. The right one is: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#if (!defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) \</span> <span class="cp"> &amp;&amp; !defined(BOOST_RESULT_OF_USE_DECLTYPE)) \</span> <span class="cp"> || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Tue, 01 Sep 2015 02:34:53 GMT</pubDate> <title>component changed https://svn.boost.org/trac10/ticket/11606#comment:2 https://svn.boost.org/trac10/ticket/11606#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">spirit</span> → <span class="trac-field-new">fusion</span> </li> </ul> <p> Can I get a minimal reproducible code (or your keywords.cpp)? </p> <p> BTW, I'm planning to remove fusion's result_of hacks and becoming SFINAE-friendly. It should fix the issue. </p> Ticket Nikki Chumakov <nikkikom@…> Tue, 01 Sep 2015 03:12:08 GMT <link>https://svn.boost.org/trac10/ticket/11606#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:3</guid> <description> <p> Thank you for the fast reply. </p> <p> keywords.cpp was the one of the standard tests in spirit repository. Here is the direct link to github for this file: <a class="ext-link" href="https://github.com/boostorg/spirit/blob/master/repository/test/qi/keywords.cpp"><span class="icon">​</span>https://github.com/boostorg/spirit/blob/master/repository/test/qi/keywords.cpp</a> </p> <p> I've read previously about the plans for fusion's "sfinae-fiction" but I also read this will require to reimplement a lot of code in it. So it may be a very time consuming task, as far as I understand. </p> <p> By now I had to fork fusion into my code, fix result_of.hpp inside and use BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK. I would appreciate any solution that will not require the fusion fork with my custom fixes inside. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Mon, 07 Sep 2015 15:50:49 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/11606#comment:4 https://svn.boost.org/trac10/ticket/11606#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.60.0</span> </li> </ul> <p> OK, I overhauled fusion::fold and it should work with decltype based result_of. </p> <p> Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully. </p> <p> see: <a class="ext-link" href="https://github.com/boostorg/fusion/pull/102"><span class="icon">​</span>https://github.com/boostorg/fusion/pull/102</a> </p> Ticket Nikki Chumakov <nikkikom@…> Wed, 09 Sep 2015 16:05:34 GMT <link>https://svn.boost.org/trac10/ticket/11606#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:5</guid> <description> <p> I am able to compile keywords.cpp with your fixes and with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK, thank you very match. </p> <p> However, I was not able to compile it with BOOST_RESULT_OF_USE_DECLTYPE. What it the reason? </p> </description> <category>Ticket</category> </item> <item> <author>Nikki Chumakov <nikkikom@…></author> <pubDate>Wed, 09 Sep 2015 16:25:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11606#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11606#comment:4" title="Comment 4">Kohei Takahashi &lt;flast@…&gt;</a>: </p> <blockquote class="citation"> <p> OK, I overhauled fusion::fold and it should work with decltype based result_of. Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully. see: <a class="ext-link" href="https://github.com/boostorg/fusion/pull/102"><span class="icon">​</span>https://github.com/boostorg/fusion/pull/102</a> </p> </blockquote> <p> Could you please regenerate preprocessed files? There are some orphaned references to fusion::detail::result_of_with_decltype here <a class="ext-link" href="https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp"><span class="icon">​</span>https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp</a> and in other files as well. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Thu, 10 Sep 2015 02:51:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11606#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11606#comment:6" title="Comment 6">Nikki Chumakov &lt;nikkikom@…&gt;</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11606#comment:4" title="Comment 4">Kohei Takahashi &lt;flast@…&gt;</a>: </p> <blockquote class="citation"> <p> OK, I overhauled fusion::fold and it should work with decltype based result_of. Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully. see: <a class="ext-link" href="https://github.com/boostorg/fusion/pull/102"><span class="icon">​</span>https://github.com/boostorg/fusion/pull/102</a> </p> </blockquote> <p> Could you please regenerate preprocessed files? There are some orphaned references to fusion::detail::result_of_with_decltype here <a class="ext-link" href="https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp"><span class="icon">​</span>https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp</a> and in other files as well. </p> </blockquote> <p> Preprocessed files make often pull-request a huge change and to be hard to review it. I'll open a additional PR which only contains preprocessed files after it is merged. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Sat, 17 Oct 2015 02:25:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11606#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11606#comment:5" title="Comment 5">Nikki Chumakov &lt;nikkikom@…&gt;</a>: </p> <blockquote class="citation"> <p> However, I was not able to compile it with BOOST_RESULT_OF_USE_DECLTYPE. What it the reason? </p> </blockquote> <p> I'm not sure is the keywords.hpp aware SFINAE-friendly result_of? </p> </description> <category>Ticket</category> </item> <item> <author>Nikita Kniazev <nok.raven@…></author> <pubDate>Thu, 14 Dec 2017 18:58:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11606#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11606#comment:9</guid> <description> <p> Should have been fixed in <a class="ext-link" href="https://github.com/boostorg/spirit/pull/256"><span class="icon">​</span>https://github.com/boostorg/spirit/pull/256</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Fri, 15 Dec 2017 00:02:18 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11606#comment:10 https://svn.boost.org/trac10/ticket/11606#comment:10 <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