Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51272 - in branches/release: . boost status
From: eric_at_[hidden]
Date: 2009-02-16 13:03:42


Author: eric_niebler
Date: 2009-02-16 13:03:41 EST (Mon, 16 Feb 2009)
New Revision: 51272
URL: http://svn.boost.org/trac/boost/changeset/51272

Log:
Merged revisions 51169,51271 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r51169 | eric_niebler | 2009-02-09 16:50:16 -0800 (Mon, 09 Feb 2009) | 1 line
  
  eliminate shadow warnings on gcc for nested FOREACH loops
........
  r51271 | eric_niebler | 2009-02-16 09:50:31 -0800 (Mon, 16 Feb 2009) | 1 line
  
  mark up foreach failures on borland-6.1
........

Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/boost/foreach.hpp | 81 ++++++++++++++++++++++-----------------
   branches/release/status/explicit-failures-markup.xml | 8 +++
   2 files changed, 54 insertions(+), 35 deletions(-)

Modified: branches/release/boost/foreach.hpp
==============================================================================
--- branches/release/boost/foreach.hpp (original)
+++ branches/release/boost/foreach.hpp 2009-02-16 13:03:41 EST (Mon, 16 Feb 2009)
@@ -868,6 +868,17 @@
 # define BOOST_FOREACH_SUPPRESS_WARNINGS()
 #endif
 
+///////////////////////////////////////////////////////////////////////////////
+// Define a macro for giving hidden variables a unique name. Not strictly
+// needed, but eliminates some warnings on some compilers.
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+// With some versions of MSVC, use of __LINE__ to create unique identifiers
+// can fail when the Edit-and-Continue debug flag is used.
+# define BOOST_FOREACH_ID(x) x
+#else
+# define BOOST_FOREACH_ID(x) BOOST_PP_CAT(x, __LINE__)
+#endif
+
 // A sneaky way to get the type of the collection without evaluating the expression
 #define BOOST_FOREACH_TYPEOF(COL) \
     (true ? 0 : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL)))
@@ -912,11 +923,11 @@
 // Declare a variable to track the rvalue-ness of the collection expression
 # define BOOST_FOREACH_PREAMBLE() \
     BOOST_FOREACH_SUPPRESS_WARNINGS() \
- if (bool _foreach_is_rvalue = false) {} else
+ if (bool BOOST_FOREACH_ID(_foreach_is_rvalue) = false) {} else
 
 // Evaluate the collection expression, and detect if it is an lvalue or and rvalue
 # define BOOST_FOREACH_EVALUATE(COL) \
- (true ? boost::foreach_detail_::make_probe((COL), _foreach_is_rvalue) : (COL))
+ (true ? boost::foreach_detail_::make_probe((COL), BOOST_FOREACH_ID(_foreach_is_rvalue)) : (COL))
 
 // The rvalue/lvalue-ness of the collection expression is determined dynamically, unless
 // type type is an array or is noncopyable or is non-const, in which case we know it's an lvalue.
@@ -928,7 +939,7 @@
           , BOOST_FOREACH_IS_NONCOPYABLE(COL) \
           , boost::foreach_detail_::not_(boost::foreach_detail_::is_const_(COL))) \
       , true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \
- , &_foreach_is_rvalue))
+ , &BOOST_FOREACH_ID(_foreach_is_rvalue)))
 
 #elif !defined(BOOST_FOREACH_NO_RVALUE_DETECTION)
 ///////////////////////////////////////////////////////////////////////////////
@@ -976,58 +987,58 @@
 
 #define BOOST_FOREACH_BEGIN(COL) \
     boost::foreach_detail_::begin( \
- _foreach_col \
+ BOOST_FOREACH_ID(_foreach_col) \
       , BOOST_FOREACH_TYPEOF(COL) \
       , BOOST_FOREACH_SHOULD_COPY(COL))
 
 #define BOOST_FOREACH_END(COL) \
     boost::foreach_detail_::end( \
- _foreach_col \
+ BOOST_FOREACH_ID(_foreach_col) \
       , BOOST_FOREACH_TYPEOF(COL) \
       , BOOST_FOREACH_SHOULD_COPY(COL))
 
 #define BOOST_FOREACH_DONE(COL) \
     boost::foreach_detail_::done( \
- _foreach_cur \
- , _foreach_end \
+ BOOST_FOREACH_ID(_foreach_cur) \
+ , BOOST_FOREACH_ID(_foreach_end) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 #define BOOST_FOREACH_NEXT(COL) \
     boost::foreach_detail_::next( \
- _foreach_cur \
+ BOOST_FOREACH_ID(_foreach_cur) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 #define BOOST_FOREACH_DEREF(COL) \
     boost::foreach_detail_::deref( \
- _foreach_cur \
+ BOOST_FOREACH_ID(_foreach_cur) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 #define BOOST_FOREACH_RBEGIN(COL) \
     boost::foreach_detail_::rbegin( \
- _foreach_col \
+ BOOST_FOREACH_ID(_foreach_col) \
       , BOOST_FOREACH_TYPEOF(COL) \
       , BOOST_FOREACH_SHOULD_COPY(COL))
 
 #define BOOST_FOREACH_REND(COL) \
     boost::foreach_detail_::rend( \
- _foreach_col \
+ BOOST_FOREACH_ID(_foreach_col) \
       , BOOST_FOREACH_TYPEOF(COL) \
       , BOOST_FOREACH_SHOULD_COPY(COL))
 
 #define BOOST_FOREACH_RDONE(COL) \
     boost::foreach_detail_::rdone( \
- _foreach_cur \
- , _foreach_end \
+ BOOST_FOREACH_ID(_foreach_cur) \
+ , BOOST_FOREACH_ID(_foreach_end) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 #define BOOST_FOREACH_RNEXT(COL) \
     boost::foreach_detail_::rnext( \
- _foreach_cur \
+ BOOST_FOREACH_ID(_foreach_cur) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 #define BOOST_FOREACH_RDEREF(COL) \
     boost::foreach_detail_::rderef( \
- _foreach_cur \
+ BOOST_FOREACH_ID(_foreach_cur) \
       , BOOST_FOREACH_TYPEOF(COL))
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1056,16 +1067,16 @@
 // BOOST_FOREACH(i, int_list)
 // { ... }
 //
-#define BOOST_FOREACH(VAR, COL) \
- BOOST_FOREACH_PREAMBLE() \
- if (boost::foreach_detail_::auto_any_t _foreach_col = BOOST_FOREACH_CONTAIN(COL)) {} else \
- if (boost::foreach_detail_::auto_any_t _foreach_cur = BOOST_FOREACH_BEGIN(COL)) {} else \
- if (boost::foreach_detail_::auto_any_t _foreach_end = BOOST_FOREACH_END(COL)) {} else \
- for (bool _foreach_continue = true; \
- _foreach_continue && !BOOST_FOREACH_DONE(COL); \
- _foreach_continue ? BOOST_FOREACH_NEXT(COL) : (void)0) \
- if (boost::foreach_detail_::set_false(_foreach_continue)) {} else \
- for (VAR = BOOST_FOREACH_DEREF(COL); !_foreach_continue; _foreach_continue = true)
+#define BOOST_FOREACH(VAR, COL) \
+ BOOST_FOREACH_PREAMBLE() \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_BEGIN(COL)) {} else \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_END(COL)) {} else \
+ for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \
+ BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_DONE(COL); \
+ BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_NEXT(COL) : (void)0) \
+ if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \
+ for (VAR = BOOST_FOREACH_DEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true)
 
 ///////////////////////////////////////////////////////////////////////////////
 // BOOST_REVERSE_FOREACH
@@ -1074,15 +1085,15 @@
 // all other respects, BOOST_REVERSE_FOREACH is like
 // BOOST_FOREACH.
 //
-#define BOOST_REVERSE_FOREACH(VAR, COL) \
- BOOST_FOREACH_PREAMBLE() \
- if (boost::foreach_detail_::auto_any_t _foreach_col = BOOST_FOREACH_CONTAIN(COL)) {} else \
- if (boost::foreach_detail_::auto_any_t _foreach_cur = BOOST_FOREACH_RBEGIN(COL)) {} else \
- if (boost::foreach_detail_::auto_any_t _foreach_end = BOOST_FOREACH_REND(COL)) {} else \
- for (bool _foreach_continue = true; \
- _foreach_continue && !BOOST_FOREACH_RDONE(COL); \
- _foreach_continue ? BOOST_FOREACH_RNEXT(COL) : (void)0) \
- if (boost::foreach_detail_::set_false(_foreach_continue)) {} else \
- for (VAR = BOOST_FOREACH_RDEREF(COL); !_foreach_continue; _foreach_continue = true)
+#define BOOST_REVERSE_FOREACH(VAR, COL) \
+ BOOST_FOREACH_PREAMBLE() \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_RBEGIN(COL)) {} else \
+ if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_REND(COL)) {} else \
+ for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \
+ BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_RDONE(COL); \
+ BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_RNEXT(COL) : (void)0) \
+ if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \
+ for (VAR = BOOST_FOREACH_RDEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true)
 
 #endif

Modified: branches/release/status/explicit-failures-markup.xml
==============================================================================
--- branches/release/status/explicit-failures-markup.xml (original)
+++ branches/release/status/explicit-failures-markup.xml 2009-02-16 13:03:41 EST (Mon, 16 Feb 2009)
@@ -1490,6 +1490,8 @@
             <toolset name="borland-5.6*"/>
             <toolset name="borland-5.8*"/>
             <toolset name="borland-5.9*"/>
+ <toolset name="borland-6.0*"/>
+ <toolset name="borland-6.1*"/>
             <toolset name="gcc-2*"/>
             <toolset name="gcc-3.2*"/>
             <toolset name="gcc-3_3-darwin"/>
@@ -1518,6 +1520,8 @@
             <toolset name="borland-5.6*"/>
             <toolset name="borland-5.8*"/>
             <toolset name="borland-5.9*"/>
+ <toolset name="borland-6.0*"/>
+ <toolset name="borland-6.1*"/>
             <toolset name="gcc-2*"/>
             <toolset name="gcc-3.2*"/>
             <toolset name="gcc-3_3-darwin"/>
@@ -1546,6 +1550,8 @@
             <toolset name="borland-5.6*"/>
             <toolset name="borland-5.8*"/>
             <toolset name="borland-5.9*"/>
+ <toolset name="borland-6.0*"/>
+ <toolset name="borland-6.1*"/>
             <toolset name="hp_cxx*"/>
             <toolset name="sunpro*"/>
             <toolset name="sun-5.7"/>
@@ -1563,6 +1569,8 @@
             <toolset name="borland-5.6*"/>
             <toolset name="borland-5.8*"/>
             <toolset name="borland-5.9*"/>
+ <toolset name="borland-6.0*"/>
+ <toolset name="borland-6.1*"/>
             <toolset name="hp_cxx*"/>
             <toolset name="sunpro*"/>
             <toolset name="sun-5.7"/>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk