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: | 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)
Change History (2)
by , 12 years ago
Attachment: | bcv.tar.gz added |
---|
comment:1 by , 12 years ago
Cc: | added |
---|---|
Milestone: | Boost 1.44.0 → Boost 1.46.0 |
Owner: | changed from | to
Version: | Boost 1.43.0 → Boost Development Trunk |
Confirmed, this is still a problem in g++-4.2, g++-4.5 and clang.
Demonstrates the BOOST_MPL_ASSERT problem using boost serialization