Boost C++ Libraries: Ticket #11211: Fusion example no longer compiles (BOOST_FUSION_DEFINE_STRUCT) https://svn.boost.org/trac10/ticket/11211 <p> From the manual: </p> <pre class="wiki"> #include &lt;string&gt; #include "boost/fusion/adapted/struct/define_struct.hpp" // demo::employee is a Fusion sequence BOOST_FUSION_DEFINE_STRUCT( (demo), employee, (std::string, name) (int, age)) int main() { } </pre><p> It fails to compile with boost 1.58. With boost 1.57, compiles successfully. </p> <blockquote> <p> g++ --std=c++11 test.cpp -I /home/saknussemm/downloads/boost_1_58_0 </p> </blockquote> <p> clang fails with a similar error. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11211 Trac 1.4.3 Adrián Etchevarne <adrian.etchevarne@…> Mon, 20 Apr 2015 19:16:12 GMT attachment set https://svn.boost.org/trac10/ticket/11211 https://svn.boost.org/trac10/ticket/11211 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">error.txt</span> </li> </ul> Ticket Adrián Etchevarne <adrian.etchevarne@…> Mon, 20 Apr 2015 19:26:27 GMT severity, summary changed https://svn.boost.org/trac10/ticket/11211#comment:1 https://svn.boost.org/trac10/ticket/11211#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Regression</span> </li> <li><strong>summary</strong> <span class="trac-field-old">Fusion example no longer compiles</span> → <span class="trac-field-new">Fusion example no longer compiles (BOOST_FUSION_DEFINE_STRUCT)</span> </li> </ul> Ticket Joel de Guzman Mon, 20 Apr 2015 19:44:18 GMT <link>https://svn.boost.org/trac10/ticket/11211#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:2</guid> <description> <p> confirmed clang and g++. i added this test case. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Tue, 21 Apr 2015 00:00:12 GMT</pubDate> <title>milestone changed; cc set https://svn.boost.org/trac10/ticket/11211#comment:3 https://svn.boost.org/trac10/ticket/11211#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">flast@…</span> added </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> <p> Confirmed. </p> <p> Ah, I see, it's my bad. </p> <p> The constructors of BOOST_FUSION_DEFINE_STRUCT (might other variations too) is not a template: the constructors of each elements must be constexpr. </p> Ticket damien.buhl@… Tue, 21 Apr 2015 07:14:01 GMT <link>https://svn.boost.org/trac10/ticket/11211#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:4</guid> <description> <p> Sorry I didn't see you already handled the problem. I made a pull-request on github in between. It is ok for you or you wanted to do something finer ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 21 Apr 2015 07:26:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:5</guid> <description> <blockquote> <p> I just added a test case, not a fix. Is there another PR? Anyway, I merged Damien's. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 21 Apr 2015 07:28:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:5</guid> <description> <blockquote> <p> I just added a test case, not a fix. Is there another PR? Anyway, I merged Damien's. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>damien.buhl@…</author> <pubDate>Mon, 27 Apr 2015 08:30:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:6</guid> <description> <p> I added another PR for BOOST_FUSION_DEFINE_INLINE_STRUCT and added some other test cases. </p> <p> I thought for people who are using the library in version 1.58 right now they can work the issue around with : <code>g++ -DBOOST_CONSTEXPR= </code> </p> </description> <category>Ticket</category> </item> <item> <author>Adrián Etchevarne <adrian.etchevarne@…></author> <pubDate>Tue, 28 Apr 2015 15:27:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:7</guid> <description> <blockquote class="citation"> <p> I thought for people who are using the library in version 1.58 right now they can work the issue around with : <code>g++ -DBOOST_CONSTEXPR= </code> </p> </blockquote> <p> Unfortunately, this workaround doesn't work. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Wed, 29 Apr 2015 08:48:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:8</guid> <description> <p> I think we should release some patches to fix this issue, like ttps://github.com/boostorg/website/blob/master/feed/history/boost_1_58_0.qbk#L25-L40 . </p> <p> candidates </p> <ul><li>ttps://github.com/boostorg/fusion/pull/70 </li><li>ttps://github.com/boostorg/fusion/pull/71 </li></ul> </description> <category>Ticket</category> </item> <item> <author>Dennis Brentjes <d.brentjes@…></author> <pubDate>Mon, 04 May 2015 09:28:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:9</guid> <description> <p> Here is another minimal test case that fails to compile (in c++11) but now using BOOST_FUSION_ADAPT_STRUCT. I suspect that it is the same issue. </p> <pre class="wiki">#include &lt;boost/fusion/adapted/struct.hpp&gt; struct X {}; BOOST_FUSION_ADAPT_STRUCT( X, ) int main() { return 0; } </pre> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Mon, 04 May 2015 14:48:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:10</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11211#comment:9" title="Comment 9">Dennis Brentjes &lt;d.brentjes@…&gt;</a>: </p> <blockquote class="citation"> <p> Here is another minimal test case that fails to compile (in c++11) but now using BOOST_FUSION_ADAPT_STRUCT. I suspect that it is the same issue. </p> <pre class="wiki">#include &lt;boost/fusion/adapted/struct.hpp&gt; struct X {}; BOOST_FUSION_ADAPT_STRUCT( X, ) int main() { return 0; } </pre></blockquote> <p> No, it's not a same issue; you can test with <code>-DBOOST_NO_CXX11_CONSTEXPR</code> flag to disabling <code>BOOST_CONSTEXPR</code> feature. </p> <p> In original test case, work with <code>-DBOOST_NO_CXX11_CONSTEXPR</code> due to avoiding regression: <a class="ext-link" href="http://melpon.org/wandbox/permlink/APJ0Vi289gSKA7MO"><span class="icon">​</span>http://melpon.org/wandbox/permlink/APJ0Vi289gSKA7MO</a> . However, your case dosn't work even defining <code>-DBOOST_NO_CXX11_CONSTEXPR</code>: <a class="ext-link" href="http://melpon.org/wandbox/permlink/ktex1HEt5w4bplsv"><span class="icon">​</span>http://melpon.org/wandbox/permlink/ktex1HEt5w4bplsv</a> . </p> </description> <category>Ticket</category> </item> <item> <author>Dennis Brentjes <d.brentjes@…></author> <pubDate>Tue, 05 May 2015 12:46:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:11</guid> <description> <p> You are right. It seems it's related to adapting an empty struct. Something which was possible in 1.57. Should I create a separate ticket for this issue? </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Tue, 05 May 2015 14:10:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11211#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11211#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11211#comment:11" title="Comment 11">Dennis Brentjes &lt;d.brentjes@…&gt;</a>: </p> <blockquote class="citation"> <p> Should I create a separate ticket for this issue? </p> </blockquote> <p> Yes, please! </p> <p> Joel, I think this issue is now fixed and can be closed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 05 May 2015 19:32:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11211#comment:13 https://svn.boost.org/trac10/ticket/11211#comment:13 <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