Subject: [Boost-bugs] [Boost C++ Libraries] #10467: Boost.Geometry fails to compile on OS X if sys/termios.h is included
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-09-05 14:57:32
#10467: Boost.Geometry fails to compile on OS X if sys/termios.h is included
------------------------------+---------------------------
Reporter: nneonneo | Owner: barendgehrels
Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.56.0 | Severity: Regression
Keywords: |
------------------------------+---------------------------
On OS X, sys/termios.h defines the symbol B0 as 0.
With Boost 1.56.0, including sys/termios.h before
boost/geometry/algorithms/assign.hpp causes a compilation failure which
looks like this:
{{{
In file included from test.cpp:2:
/opt/local/include/boost/geometry/algorithms/assign.hpp:320:50: error:
expected a qualified name after 'typename'
template <BOOST_VARIANT_ENUM_PARAMS(typename A),
BOOST_VARIANT_ENUM_PARAMS(typename B)>
^
/opt/local/include/boost/variant/variant_fwd.hpp:164:5: note: expanded
from macro 'BOOST_VARIANT_ENUM_PARAMS'
BOOST_PP_ENUM_PARAMS(BOOST_VARIANT_LIMIT_TYPES, param)
^
/opt/local/include/boost/preprocessor/repetition/enum_params.hpp:24:71:
note: expanded from macro 'BOOST_PP_ENUM_PARAMS'
# define BOOST_PP_ENUM_PARAMS(count, param) BOOST_PP_REPEAT(count,
BOOST_PP_ENUM_PARAMS_M, param)
^
/opt/local/include/boost/preprocessor/repetition/repeat.hpp:38:60: note:
expanded from macro 'BOOST_PP_REPEAT_1'
# define BOOST_PP_REPEAT_1(c, m, d) BOOST_PP_REPEAT_1_I(c, m, d)
^
note: (skipping 21 expansions in backtrace; use -fmacro-backtrace-limit=0
to see all)
/opt/local/include/boost/preprocessor/repetition/enum_params.hpp:30:67:
note: expanded from macro 'BOOST_PP_ENUM_PARAMS_M'
# define BOOST_PP_ENUM_PARAMS_M(z, n, param) BOOST_PP_COMMA_IF(n) param ##
n
^
<scratch space>:13:1: note: expanded from here
B0
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/termios.h:291:12:
note: expanded from
macro 'B0'
#define B0 0
^
}}}
The problem is that BOOST_VARIANT_ENUM_PARAMS(typename B) expands to a
series of type params including "typename B0", which is then further
expanded to "typename 0" by the B0 macro, and that causes a compilation
failure.
This is a regression: the observed behaviour did not appear under Boost
1.55.0.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10467> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC