Opened 11 years ago

Closed 9 years ago

#6729 closed Bugs (invalid)

boost/type_traits.hpp 1.49.0 does not compile with gcc 4.5.2

Reported by: janitor048@… Owned by: bronf
Milestone: To Be Determined Component: type_traits
Version: Boost 1.49.0 Severity: Regression
Keywords: Cc:

Description

Programs including boost::multi_array do not compile with gcc 4.5.2. This can be reproduced by simply trying to include boost/multi_array.hpp. Minimal example:

#include <boost/multi_array.hpp>

int main()
{
  return 0;
}

This produces a lot of compiler errors such as

In file included from /home/janitor/usr/include/boost/type_traits/has_bit_and.hpp:43:0,                                                                          
                 from /home/janitor/usr/include/boost/type_traits/has_operator.hpp:12,
                 from /home/janitor/usr/include/boost/type_traits.hpp:35,
                 from /home/janitor/usr/include/boost/multi_array.hpp:30,
                 from /home/janitor/cascade/testing/binningClass/src/main.cpp:4:
/home/janitor/usr/include/boost/type_traits/detail/has_binary_operator.hpp:221:29: error: expected constructor, destructor, or type conversion before ‘(’ token

gcc version is 4.5.2: gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
System information: x86_64 GNU/Linux (2.6.38-13-generic)

Using boost 1.42 the problem does not exist. Also the same code compiles with boost 1.49.0 and gcc 4.4.4

Change History (9)

comment:1 by Ronald Garcia, 11 years ago

What happens if instead of multi_array.hpp you #include <boost/type_traits.hpp>

? Based on the error message, it looks like the problem might be isolated there.

comment:2 by janitor048@…, 11 years ago

Yes, you are right. The problem occurs when I include <boost/type_traits.hpp>. Sorry, that I missed this in the compiler messages. Can you reassign it to the correct component?

comment:3 by Ronald Garcia, 11 years ago

Component: multi_arraytype_traits
Owner: changed from Ronald Garcia to John Maddock
Summary: boost::multi_array 1.49.0 does not compile with gcc 4.5.2boost/type_traits.hpp 1.49.0 does not compile with gcc 4.5.2

comment:4 by John Maddock, 11 years ago

Owner: changed from John Maddock to bronf

Reassigning owner.

comment:5 by Tim.Odenthal@…, 10 years ago

The problem persists in boost 1_51_0, compiling with g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1... No fix yet? Since it's a several-line macro-call which obviously generates something deemed incorrect by g++, I have no reasonable way of debugging this myself... BTW. the error occurred trying to compile CGAL.

in reply to:  5 ; comment:6 by Tim.Odenthal@…, 10 years ago

Changing to g++ and gcc version 4.4.6 didn't help in my case!

in reply to:  6 comment:7 by Tim.Odenthal@…, 10 years ago

What did fix it in my case was completely deleting and re-installing the boost headers. Actually looking there, it must have been an old file which didn't define the macro needed... Strange stuff.

comment:8 by viboes, 9 years ago

Could we close this ticket then?

comment:9 by John Maddock, 9 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.