Opened 12 years ago

Last modified 12 years ago

#4351 new Bugs

boost 1_43_0 BOOST_MPL_ASSERT compile error (gcc 4.2)

Reported by: Jeff Epler <jepler@…> Owned by: Joel Falcou
Milestone: Boost 1.46.0 Component: mpl
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: jepler@…, michael@…, admin@…

Description

The simple version:

#include <boost/mpl/assert.hpp>
int main() { BOOST_MPL_ASSERT((1)); BOOST_MPL_ASSERT((1)); return 0;}

(it is important that both BOOST_MPL_ASSERT invocations are on the same line)

On gcc 4.2.4 (Ubuntu 8.04), this leads to the following error:

$ 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()::<anonymous enum> mpl_assertion_in_line_2’

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 on the same source line (e.g., fooclass.h line 30 and barclass.h line 30) a similar error results.

The attached tar file demonstrates the original problem with BOOST_CLASS_VERSION that first came to my attention.

Attachments (1)

bcv.tar.gz (333 bytes ) - added by Jeff Epler <jepler@…> 12 years ago.
Demonstrates the BOOST_MPL_ASSERT problem using boost serialization

Download all attachments as: .zip

Change History (2)

by Jeff Epler <jepler@…>, 12 years ago

Attachment: bcv.tar.gz added

Demonstrates the BOOST_MPL_ASSERT problem using boost serialization

comment:1 by Bryce Adelstein Lelbach, 12 years ago

Cc: admin@… added
Milestone: Boost 1.44.0Boost 1.46.0
Owner: changed from Aleksey Gurtovoy to Joel Falcou
Version: Boost 1.43.0Boost Development Trunk

Confirmed, this is still a problem in g++-4.2, g++-4.5 and clang.

Note: See TracTickets for help on using tickets.