Boost C++ Libraries: Ticket #12436: BOOST_FUSION_DEFINE_STRUCT fails if a member type starts with "::" https://svn.boost.org/trac10/ticket/12436 <p> The following code compiles fine in boost-1.57 but fails in boost-1.59 and later. </p> <p> Example: </p> <pre class="wiki">#include &lt;string&gt; #include &lt;boost/fusion/adapted/struct/define_struct.hpp&gt; #include &lt;boost/fusion/include/define_struct.hpp&gt; #include &lt;boost/fusion/include/adapt_struct.hpp&gt; BOOST_FUSION_DEFINE_STRUCT( (demo), employee, (::std::size_t, age)) </pre><p> The error shown by clang: </p> <pre class="wiki">fusion.cpp:6:1: error: pasting formed 'BOOST_PP_IS_EMPTY_DEF_::', an invalid preprocessing token BOOST_FUSION_DEFINE_STRUCT( ^ /Users/grubber/src/work/boost-1.59.0/boost/fusion/adapted/struct/define_struct.hpp:38:5: note: expanded from macro 'BOOST_FUSION_DEFINE_STRUCT' BOOST_FUSION_ADAPT_STRUCT( \ ^ /Users/grubber/src/work/boost-1.59.0/boost/fusion/adapted/struct/adapt_struct.hpp:110:17: note: expanded from macro 'BOOST_FUSION_ADAPT_STRUCT' BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \ ^ /Users/grubber/src/work/boost-1.59.0/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp:25:5: note: expanded from macro 'BOOST_FUSION_ADAPT_STRUCT_FILLER_0' BOOST_FUSION_ADAPT_STRUCT_FILLER_1 ^ note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) /Users/grubber/src/work/boost-1.59.0/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp:35:17: note: expanded from macro 'BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR' BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ ^ /Users/grubber/src/work/boost-1.59.0/boost/preprocessor/facilities/is_empty.hpp:35:34: note: expanded from macro 'BOOST_PP_IS_EMPTY' # define BOOST_PP_IS_EMPTY(x) BOOST_PP_IS_EMPTY_I(x BOOST_PP_IS_EMPTY_HELPER) ^ /Users/grubber/src/work/boost-1.59.0/boost/preprocessor/facilities/is_empty.hpp:36:93: note: expanded from macro 'BOOST_PP_IS_EMPTY_I' # define BOOST_PP_IS_EMPTY_I(contents) BOOST_PP_TUPLE_ELEM(2, 1, (BOOST_PP_IS_EMPTY_DEF_ ## contents())) ^ 1 error generated. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12436 Trac 1.4.3 anonymous Mon, 05 Sep 2016 03:46:15 GMT summary changed https://svn.boost.org/trac10/ticket/12436#comment:1 https://svn.boost.org/trac10/ticket/12436#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">Fusion fails if a member type starts with "::"</span> → <span class="trac-field-new">BOOST_FUSION_DEFINE_STRUCT fails if a member type starts with "::"</span> </li> </ul> Ticket Joel de Guzman Mon, 05 Sep 2016 05:46:34 GMT <link>https://svn.boost.org/trac10/ticket/12436#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12436#comment:2</guid> <description> <p> I think this is more or an issue with Boost preprocessor instead of Fusion. no? It's not perfect. The workaround of corse is to declare a typedef outside of the macro. </p> </description> <category>Ticket</category> </item> <item> <author>jaredgrubb+boosttrac@…</author> <pubDate>Thu, 06 Oct 2016 16:01:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12436#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12436#comment:3</guid> <description> <p> Doing a quick diff between 1.57 and 1.59, I don't see many changes to the MPL macros, but I see a lot of changes in Fusion in the Adapted part, so it's probably Fusion that changed. </p> <p> Although the workaround is to use a typedef (or to avoid a situation where leading colons are required), the sample code seems like it should be supported -- especially given that it used to be. </p> </description> <category>Ticket</category> </item> </channel> </rss>