[Boost-bugs] [Boost C++ Libraries] #6631: BOOST_PP_ITERATION_FLAGS(): error: missing binary operator before token "("

Subject: [Boost-bugs] [Boost C++ Libraries] #6631: BOOST_PP_ITERATION_FLAGS(): error: missing binary operator before token "("
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-29 02:49:34


#6631: BOOST_PP_ITERATION_FLAGS(): error: missing binary operator before token "("
--------------------------------------+-------------------------------------
 Reporter: peter@… | Owner: no-maintainer
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: preprocessor
  Version: Boost 1.49.0 | Severity: Regression
 Keywords: BOOST_PP_ITERATION_FLAGS |
--------------------------------------+-------------------------------------
 With Boost 1.49.0 and GCC, use of BOOST_PP_ITERATION_FLAGS() results in a
 compiler error:

 {{{
 # g++ -I $HOME/usr/rhel6-x86_64/boost_1_49_0/include -I. -o file -O2
 file.cpp
 In file included from file.cpp:1:0:
 file.h:19:1: error: missing binary operator before token "("
 file.h:24:1: error: missing binary operator before token "("
 }}}

 As a reproducable test case, I compiled the example given in the
 Boost.Preprocessor documentation:

 {{{
 // file.h
 #if !BOOST_PP_IS_ITERATING

    #ifndef FILE_H_
    #define FILE_H_

    #include <boost/preprocessor/iteration/iterate.hpp>

    // 1st iteration:
    #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0001))
    #include BOOST_PP_ITERATE()

    // 2nd iteration:
    #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0002))
    #include BOOST_PP_ITERATE()

    #endif

 #elif BOOST_PP_ITERATION_DEPTH() == 1 \
    && BOOST_PP_ITERATION_FLAGS() == 0x0001 \
    /**/


 #elif BOOST_PP_ITERATION_DEPTH() == 1 \
    && BOOST_PP_ITERATION_FLAGS() == 0x0002 \
    /**/


 #endif
 }}}

 {{{
 // file.cpp
 #include "file.h"
 int main() {}
 }}}

 Both GCC 4.4 and GCC 4.6 fail to compile the example using Boost 1.49.0.

 The above code compiles fine using Boost 1.48.0.

 g++ (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)

 g++ (GCC) 4.6.2 20110728 (prerelease)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6631>
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:09 UTC