Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83840 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/karma/auto boost/spirit/home/karma/binary boost/spirit/home/karma/char boost/spirit/home/karma/numeric boost/spirit/home/karma/stream boost/spirit/home/karma/string boost/spirit/home/support boost/spirit/repository/home/karma/nonterminal boost/spirit/repository/home/qi/nonterminal
From: hartmut.kaiser_at_[hidden]
Date: 2013-04-10 18:51:15


Author: hkaiser
Date: 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
New Revision: 83840
URL: http://svn.boost.org/trac/boost/changeset/83840

Log:
Spirit: merging from trunk
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/karma/auto/auto.hpp | 2 +-
   branches/release/boost/spirit/home/karma/binary/binary.hpp | 2 +-
   branches/release/boost/spirit/home/karma/char/char.hpp | 14 +++++++-------
   branches/release/boost/spirit/home/karma/char/char_class.hpp | 6 +++---
   branches/release/boost/spirit/home/karma/numeric/bool.hpp | 2 +-
   branches/release/boost/spirit/home/karma/numeric/int.hpp | 6 +++---
   branches/release/boost/spirit/home/karma/numeric/real.hpp | 3 ++-
   branches/release/boost/spirit/home/karma/numeric/uint.hpp | 2 +-
   branches/release/boost/spirit/home/karma/stream/stream.hpp | 6 +++---
   branches/release/boost/spirit/home/karma/string/lit.hpp | 2 +-
   branches/release/boost/spirit/home/support/assert_msg.hpp | 16 +++++++++++++++-
   branches/release/boost/spirit/repository/home/karma/nonterminal/subrule.hpp | 4 ++--
   branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp | 4 ++--
   13 files changed, 42 insertions(+), 27 deletions(-)

Modified: branches/release/boost/spirit/home/karma/auto/auto.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/auto/auto.hpp (original)
+++ branches/release/boost/spirit/home/karma/auto/auto.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -90,7 +90,7 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, auto_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, auto_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/karma/binary/binary.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/binary/binary.hpp (original)
+++ branches/release/boost/spirit/home/karma/binary/binary.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -280,7 +280,7 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false,
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator,
                 binary_generator_not_usable_without_attribute, ());
             return false;
         }

Modified: branches/release/boost/spirit/home/karma/char/char.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/char/char.hpp (original)
+++ branches/release/boost/spirit/home/karma/char/char.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -137,7 +137,7 @@
             // providing any attribute, as the generator doesn't 'know' what
             // character to output. The following assertion fires if this
             // situation is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, char_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(CharParam, char_not_usable_without_attribute, ());
             return false;
         }
 
@@ -230,11 +230,11 @@
         template <typename CharParam, typename Context>
         bool test(unused_type, CharParam&, Context&) const
         {
- // It is not possible (doesn't make sense) to use char_ generators
- // without providing any attribute, as the generator doesn't 'know'
+ // It is not possible (doesn't make sense) to use char_ generators
+ // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(CharParam
               , char_range_not_usable_without_attribute, ());
             return false;
         }
@@ -316,11 +316,11 @@
         template <typename CharParam, typename Context>
         bool test(unused_type, CharParam&, Context&) const
         {
- // It is not possible (doesn't make sense) to use char_ generators
- // without providing any attribute, as the generator doesn't 'know'
+ // It is not possible (doesn't make sense) to use char_ generators
+ // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(CharParam
                , char_set_not_usable_without_attribute, ());
             return false;
         }

Modified: branches/release/boost/spirit/home/karma/char/char_class.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/char/char_class.hpp (original)
+++ branches/release/boost/spirit/home/karma/char/char_class.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -95,11 +95,11 @@
         template <typename CharParam, typename Context>
         bool test(unused_type, CharParam&, Context&) const
         {
- // It is not possible (doesn't make sense) to use char_ generators
- // without providing any attribute, as the generator doesn't 'know'
+ // It is not possible (doesn't make sense) to use char_ generators
+ // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(CharParam
               , char_class_not_usable_without_attribute, ());
             return false;
         }

Modified: branches/release/boost/spirit/home/karma/numeric/bool.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/bool.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/bool.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -171,7 +171,7 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, bool_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, bool_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/karma/numeric/int.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/int.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/int.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2011 Hartmut Kaiser
+// Copyright (c) 2001-2012 Hartmut Kaiser
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -41,7 +41,7 @@
     namespace tag
     {
         template <typename T, unsigned Radix, bool force_sign>
- struct int_generator
+ struct int_generator
         {
             BOOST_SPIRIT_IS_TAG()
         };
@@ -252,7 +252,7 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, int_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, int_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/karma/numeric/real.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/real.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/real.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -203,7 +203,8 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, real_not_usable_without_attribute, ()); return false;
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, real_not_usable_without_attribute, ());
+ return false;
         }
 
         template <typename Context>

Modified: branches/release/boost/spirit/home/karma/numeric/uint.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/uint.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/uint.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -287,7 +287,7 @@
             // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, uint_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, uint_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/karma/stream/stream.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/stream/stream.hpp (original)
+++ branches/release/boost/spirit/home/karma/stream/stream.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -192,11 +192,11 @@
         static bool
         generate(OutputIterator&, Context&, Delimiter const&, unused_type)
         {
- // It is not possible (doesn't make sense) to use stream generators
- // without providing any attribute, as the generator doesn't 'know'
+ // It is not possible (doesn't make sense) to use stream generators
+ // without providing any attribute, as the generator doesn't 'know'
             // what to output. The following assertion fires if this situation
             // is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, stream_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, stream_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/karma/string/lit.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/string/lit.hpp (original)
+++ branches/release/boost/spirit/home/karma/string/lit.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -127,7 +127,7 @@
             // providing any attribute, as the generator doesn't 'know' what
             // character to output. The following assertion fires if this
             // situation is detected in your code.
- BOOST_SPIRIT_ASSERT_MSG(false, string_not_usable_without_attribute, ());
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, string_not_usable_without_attribute, ());
             return false;
         }
 

Modified: branches/release/boost/spirit/home/support/assert_msg.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/assert_msg.hpp (original)
+++ branches/release/boost/spirit/home/support/assert_msg.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -33,8 +33,22 @@
 
 #define BOOST_SPIRIT_ASSERT_MATCH(Domain, Expr) \
         BOOST_SPIRIT_ASSERT_MSG(( \
- boost::spirit::traits::matches<Domain, Expr>::value \
+ boost::spirit::traits::matches< Domain, Expr >::value \
         ), error_invalid_expression, (Expr))
 
+// GCC 4.7 will overeagerly instantiate static_asserts in template functions,
+// if the assert condition does not depend on template parameters
+// (see https://svn.boost.org/trac/boost/ticket/8381).
+// There are places where we want to use constant false as the condition in
+// template functions to indicate that these function overloads should never
+// be called. This allows to generate better error messages. To solve this
+// problem we make the condition dependent on the template argument and use
+// the following macro in such places.
+#include <boost/type_traits/is_same.hpp>
+
+#define BOOST_SPIRIT_ASSERT_FAIL(TemplateParam, Msg, Types) \
+ BOOST_SPIRIT_ASSERT_MSG((!boost::is_same< \
+ TemplateParam, TemplateParam >::value), Msg, Types)
+
 #endif
 

Modified: branches/release/boost/spirit/repository/home/karma/nonterminal/subrule.hpp
==============================================================================
--- branches/release/boost/spirit/repository/home/karma/nonterminal/subrule.hpp (original)
+++ branches/release/boost/spirit/repository/home/karma/nonterminal/subrule.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -503,7 +503,7 @@
         {
             // If you are seeing a compilation error here, you are trying
             // to use a subrule as a generator outside of a subrule group.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator
               , subrule_used_outside_subrule_group, (id_type));
 
             return false;
@@ -532,7 +532,7 @@
         {
             // If you are seeing a compilation error here, you are trying
             // to use a subrule as a generator outside of a subrule group.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(OutputIterator
               , subrule_used_outside_subrule_group, (id_type));
 
             return false;

Modified: branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp
==============================================================================
--- branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp (original)
+++ branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp 2013-04-10 18:51:13 EDT (Wed, 10 Apr 2013)
@@ -529,7 +529,7 @@
         {
             // If you are seeing a compilation error here, you are trying
             // to use a subrule as a parser outside of a subrule group.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(Iterator
               , subrule_used_outside_subrule_group, (id_type));
 
             return false;
@@ -558,7 +558,7 @@
         {
             // If you are seeing a compilation error here, you are trying
             // to use a subrule as a parser outside of a subrule group.
- BOOST_SPIRIT_ASSERT_MSG(false
+ BOOST_SPIRIT_ASSERT_FAIL(Iterator
               , subrule_used_outside_subrule_group, (id_type));
 
             return false;


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