|
Boost Users : |
From: Chris Fairles (chris.fairles_at_[hidden])
Date: 2008-06-18 18:34:04
On Wed, Jun 18, 2008 at 6:03 PM, Chris Fairles <chris.fairles_at_[hidden]> wrote:
> On Wed, Jun 18, 2008 at 11:18 AM, Frank Mori Hess <frank.hess_at_[hidden]> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Wednesday 18 June 2008 08:52 am, Chris Fairles wrote:
>>> On Wed, Jun 18, 2008 at 8:51 AM, Chris Fairles <chris.fairles_at_[hidden]>
>> wrote:
>>> > GCC changed the way #elif's are handled (is now more std-compliant
>>> > apparently) but this broke all the #elif BOOST_PP_ITERATION_DEPTH() ==
>>> > N lines. They need to be replaced with
>>> >
>>> > #elif defined(BOOST_PP_ITERATION_DEPTH)
>>> > #if BOOST_PP_ITERATION_DEPTH == N
>>> > ...
>>> > #endif
>>
>> Does it work if you do
>>
>> #elif defined(BOOST_PP_ITERATION_DEPTH) && BOOST_PP_ITERATION_DEPTH() == N
>>
>> then you could avoid adding the extra #endif
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.6 (GNU/Linux)
>>
>> iD8DBQFIWSdD5vihyNWuA4URAjY+AKCS3jeAhQkkbMb03vWLe4+ntvW1oACgw0Gi
>> Y0HYLTLQLAieVN+0zz8CJYQ=
>> =jIsQ
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>
> Unfortunately no. I thought at first it would, but gcc 4.4 still
> complains. Reading the std (albeit, n2606, the c++0x draft) it seems
> this is incorrect since the tokens after the pp directive combine to
> form a constant-expression and constant-expressions can be short
> circuited. There may be some special rule for the logical && in pp
> const-exprs saying that sub-expressions can be evaluated out of order,
> but I couldn't find anything.
>
I'm wrong. It's correctly erroring because:
#elif 0 && () == 1
isn't a valid constant expression.
Chris
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