Boost logo

Boost Users :

Subject: Re: [Boost-users] [preprocessor] Undeclared identifier BOOST_PP_IIF_0 under Clang only
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-04-03 11:31:22


On 4/2/2014 3:48 PM, Pierre Talbot wrote:
> Hi,
>
> I defined a macro using Boost.Preprocessor that compiles and works fine
> under gcc but fails to compile under Clang. The macro is defined here:
> https://github.com/ptal/Boost.Expected/blob/master/include/boost/functional/do_yield.hpp

As a quick shot, without actual testing, define BOOST_PP_VARIADICS to 1.

>
>
> And the error message follows this message, the file using the macro is
> https://github.com/ptal/Boost.Expected/blob/master/example/monadic_calculator/monadic_calculator.cpp
>
>
> Thanks for any helps,
> Pierre Talbot
>
> Boost.Expected/example/monadic_calculator$ b2
> ...patience...
> ...found 1246 targets...
> ...updating 2 targets...
> clang-linux.compile.c++.without-pth
> bin/clang-linux-3.5.0/debug/monadic_calculator.o
> monadic_calculator.cpp:141:15: error: use of undeclared identifier
> 'BOOST_PP_IIF_0'
> etokens = DO(
> ^
> ../../include/boost/functional/do_yield.hpp:100:17: note: expanded from
> macro 'DO'
> #define DO(...) DO_SEQ(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))
> ^
> ../../include/boost/functional/do_yield.hpp:97:3: note: expanded from
> macro 'DO_SEQ'
> BOOST_PP_SEQ_FOR_EACH_I(DO_ELEM, seq, seq) \
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/seq/for_each_i.hpp:27:55:
> note: expanded from macro 'BOOST_PP_SEQ_FOR_EACH_I'
> # define BOOST_PP_SEQ_FOR_EACH_I(macro, data, seq)
> BOOST_PP_FOR((macro, data, seq (nil), 0), BOOST_PP_SEQ_FOR_EACH_I_P,
> BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/repetition/for.hpp:27:23:
> note: expanded from macro 'BOOST_PP_FOR'
> # define BOOST_PP_FOR BOOST_PP_CAT(BOOST_PP_FOR_,
> BOOST_PP_AUTO_REC(BOOST_PP_FOR_P, 256))
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/cat.hpp:22:32: note: expanded
> from macro 'BOOST_PP_CAT'
> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/cat.hpp:29:34: note: expanded
> from macro 'BOOST_PP_CAT_I'
> # define BOOST_PP_CAT_I(a, b) a ## b
> ^
> <scratch space>:130:1: note: expanded from here
> BOOST_PP_FOR_1
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/repetition/detail/for.hpp:22:37:
> note: expanded from macro 'BOOST_PP_FOR_1'
> # define BOOST_PP_FOR_1(s, p, o, m) BOOST_PP_FOR_1_C(BOOST_PP_BOOL(p(2,
> s)), s, p, o, m)
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/repetition/detail/for.hpp:279:42:
> note: expanded from macro 'BOOST_PP_FOR_1_C'
> # define BOOST_PP_FOR_1_C(c, s, p, o, m) BOOST_PP_IIF(c, m,
> BOOST_PP_TUPLE_EAT_2)(2, s) BOOST_PP_IIF(c, BOOST_PP_FOR_2,
> BOOST_PP_TUPLE_EAT_4)(BOOST_PP_EXPR_IIF(c, o)(2, s), p, o, m)
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/control/iif.hpp:18:37: note:
> expanded from macro 'BOOST_PP_IIF'
> # define BOOST_PP_IIF(bit, t, f) BOOST_PP_IIF_I(bit, t, f)
> ^
> /usr/local/boost_1_55_0/boost/preprocessor/control/iif.hpp:25:39: note:
> expanded from macro 'BOOST_PP_IIF_I'
> # define BOOST_PP_IIF_I(bit, t, f) BOOST_PP_IIF_ ## bit(t, f)
> ^
> <scratch space>:136:1: note: expanded from here
> BOOST_PP_IIF_0
> ^


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net