Opened 6 years ago

Closed 6 years ago

#12534 closed Bugs (fixed)

flat_map fails to compile if included after type_traits is instantiated under gcc.

Reported by: eurokang@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.62.0 Severity: Regression
Keywords: Cc:

Description

Compiler gcc-5.4.0.

#include <boost/type_traits.hpp>

static const bool is_enum = boost::is_enum<std::pair<int, int> >::value;

#include <boost/container/flat_map.hpp>

boost::container::flat_map<int, int> m;

error is:

/boost/boost/container/detail/pair.hpp:433:8: error: partial specialization of ‘struct boost::is_enum<std::pair<_T1, _T2> >’ after instantiation of ‘struct boost::is_enum<std::pair<int, int> >’ [-fpermissive]

Version 1.59.0 compiles fine.

Change History (4)

comment:1 by lars@…, 6 years ago

I'm being bitten by this as well. Anyone have a fix?

comment:2 by lars@…, 6 years ago

I've managed to fix it in my code base by add an include of boost/container/map.hpp early in the include chain.

comment:3 by matt@…, 6 years ago

This affects us too. We don't have the flexibility to reorder header inclusions under all circumstances, so this is a pretty severe break for us.

comment:4 by Ion Gaztañaga, 6 years ago

Resolution: fixed
Status: newclosed

Thanks for the report. Those partial specializations are not longer needed so they are removed in the commit:

https://github.com/boostorg/container/commit/5e4a107e82ab3281688311d22d2bfc2fddcf84a3

Note: See TracTickets for help on using tickets.