Boost C++ Libraries: Ticket #4351: boost 1_43_0 BOOST_MPL_ASSERT compile error (gcc 4.2) https://svn.boost.org/trac10/ticket/4351 <p> The simple version: </p> <pre class="wiki">#include &lt;boost/mpl/assert.hpp&gt; int main() { BOOST_MPL_ASSERT((1)); BOOST_MPL_ASSERT((1)); return 0;} </pre><p> (it is important that both BOOST_MPL_ASSERT invocations are <strong>on the same line</strong>) </p> <p> On gcc 4.2.4 (Ubuntu 8.04), this leads to the following error: </p> <pre class="wiki">$ g++ -I /src/jepler/boost_1_43_0/ main.c main.c: In function ‘int main()’: main.c:2: error: conflicting declaration ‘mpl_assertion_in_line_2’ main.c:2: error: ‘mpl_assertion_in_line_2’ has a previous declaration as ‘main()::&lt;anonymous enum&gt; mpl_assertion_in_line_2’ </pre><p> I am trying to migrate an application from boost 1_34_0 to boost 1_43_0. Among other boost features, it uses boost serialization. It has BOOST_CLASS_VERSION declarations across various header files. When two header files are included in the same source file, and they both contain BOOST_CLASS_VERSION declarations <strong>on the same source line</strong> (e.g., fooclass.h line 30 and barclass.h line 30) a similar error results. </p> <p> The attached tar file demonstrates the original problem with BOOST_CLASS_VERSION that first came to my attention. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4351 Trac 1.4.3 Jeff Epler <jepler@…> Wed, 16 Jun 2010 16:11:00 GMT attachment set https://svn.boost.org/trac10/ticket/4351 https://svn.boost.org/trac10/ticket/4351 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bcv.tar.gz</span> </li> </ul> <p> Demonstrates the BOOST_MPL_ASSERT problem using boost serialization </p> Ticket Bryce Adelstein Lelbach Thu, 30 Dec 2010 14:31:31 GMT cc, owner, version, milestone changed https://svn.boost.org/trac10/ticket/4351#comment:1 https://svn.boost.org/trac10/ticket/4351#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">admin@…</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">Aleksey Gurtovoy</span> to <span class="trac-author">Joel Falcou</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost 1.46.0</span> </li> </ul> <p> Confirmed, this is still a problem in g++-4.2, g++-4.5 and clang. </p> Ticket