Boost C++ Libraries: Ticket #12426: boost/preprocessor/seq/for_each_i.hpp fails on gcc 5.4.0 and appleclang 7.3.0 https://svn.boost.org/trac10/ticket/12426 <p> I have attached test1.cpp which can be compiled with: </p> <pre class="wiki">g++ -Wall -Wextra -Werror -g -O0 -save-temps -o test1.o -c -fpic test1.cpp </pre><p> There appears to be more than 1 problem, but this at least shows that BOOST_PP_SEQ_FOR_EACH_I is broken when using these compilers (the string should not be present in the output, but is, with these compilers). Just check the test1.ii file to observe this. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12426 Trac 1.4.3 mjtruog@… Wed, 31 Aug 2016 22:49:18 GMT attachment set https://svn.boost.org/trac10/ticket/12426 https://svn.boost.org/trac10/ticket/12426 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test1.cpp</span> </li> </ul> <p> Example code </p> Ticket mjtruog@… Tue, 20 Sep 2016 21:38:07 GMT <link>https://svn.boost.org/trac10/ticket/12426#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12426#comment:1</guid> <description> <p> The diff below solves the problem, by bringing the code for the arity 0 case back to the state it was in at version 1.48 (when compared to 1.58): </p> <pre class="wiki">--- /usr/include/boost/preprocessor/tuple/to_seq.hpp 2016-09-20 13:34:52.926120462 -0700 +++ /usr/include/boost/preprocessor/tuple/to_seq.hpp 2016-09-20 13:35:02.516377864 -0700 @@ -49,7 +49,7 @@ # endif # /* An empty array can be passed */ -# define BOOST_PP_TUPLE_TO_SEQ_0() () +# define BOOST_PP_TUPLE_TO_SEQ_0() # # define BOOST_PP_TUPLE_TO_SEQ_1(e0) (e0) # define BOOST_PP_TUPLE_TO_SEQ_2(e0, e1) (e0)(e1) </pre><p> To avoid this bug in BOOST_PP_TUPLE_TO_SEQ I used the work-around below: </p> <pre class="wiki">#include &lt;boost/preprocessor/list/for_each.hpp&gt; #include &lt;boost/preprocessor/tuple/to_list.hpp&gt; #define TUPLE_TO_SEQ_E(r, data, elem) (elem) #define TUPLE_TO_SEQ(I, T) \ BOOST_PP_LIST_FOR_EACH(TUPLE_TO_SEQ_E, _, BOOST_PP_TUPLE_TO_LIST(I, T)) </pre> </description> <category>Ticket</category> </item> </channel> </rss>