Boost logo

Boost :

Subject: [boost] [preprocessor] badly formed constant expression on Sun
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-04-03 22:27:40

Hello all,

A Boost.Functional/OverloadedFunction regression test gives the errors below
on a Boost.Preprocessor line:

# if (BOOST_PP_VALUE) / 1000000000UL == 0
# define BOOST_PP_SLOT_TEMP_10 0
# elif (BOOST_PP_VALUE) / 1000000000UL == 1
# define BOOST_PP_SLOT_TEMP_10 1
# elif (BOOST_PP_VALUE) / 1000000000UL == 2
# define BOOST_PP_SLOT_TEMP_10 2
# elif (BOOST_PP_VALUE) / 1000000000UL == 3

"/opt/sunstudio12.1/bin/CC" +d -library=stlport4 -features=tmplife
-features=tmplrefstatic -library=stlport4 -g -erroff=%none -m64 -KPIC
-DBOOST_ALL_NO_LIB=1 -I".." -c -o

"../boost/preprocessor/slot/detail/shared.hpp", line 27: Error: Badly formed
constant expression.
"../boost/preprocessor/slot/detail/shared.hpp", line 29: Error: Badly formed
constant expression.
"../boost/preprocessor/slot/detail/shared.hpp", line 31: Error: Badly formed
constant expression.

Is (BOOST_PP_VALUE) / 1000000000UL not a valid constant expression on Sun
64-bits machines?

I can't reproduce this error on my Sun C++ compiler installed on 32-bit
Ubuntu Linux... so maybe this is about the actual Sun machine and not the
Sun compiler... However, all Boost.Preprocessor tests pass on Sun...

Any suggestion?

Thanks a lot.

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at