$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: hartmut.kaiser_at_[hidden]
Date: 2008-07-10 09:42:19
Author: hkaiser
Date: 2008-07-10 09:42:18 EDT (Thu, 10 Jul 2008)
New Revision: 47286
URL: http://svn.boost.org/trac/boost/changeset/47286
Log:
Wave: Fixed ticket #2102
Text files modified: 
   trunk/boost/wave/cpplexer/cpp_lex_token.hpp          |     3 ++-                                     
   trunk/boost/wave/grammars/cpp_expression_grammar.hpp |    14 +++++++++++---                          
   2 files changed, 13 insertions(+), 4 deletions(-)
Modified: trunk/boost/wave/cpplexer/cpp_lex_token.hpp
==============================================================================
--- trunk/boost/wave/cpplexer/cpp_lex_token.hpp	(original)
+++ trunk/boost/wave/cpplexer/cpp_lex_token.hpp	2008-07-10 09:42:18 EDT (Thu, 10 Jul 2008)
@@ -21,6 +21,7 @@
 #include <boost/wave/token_ids.hpp>  
 #include <boost/wave/language_support.hpp>
 
+#include <boost/throw_exception.hpp>
 #include <boost/pool/singleton_pool.hpp>
 
 // this must occur after all of the includes and before any code appears
@@ -147,7 +148,7 @@
         
     void *ret = pool_type::malloc();
     if (0 == ret)
-        throw std::bad_alloc();
+        boost::throw_exception(std::bad_alloc());
     return ret;
 }
 
Modified: trunk/boost/wave/grammars/cpp_expression_grammar.hpp
==============================================================================
--- trunk/boost/wave/grammars/cpp_expression_grammar.hpp	(original)
+++ trunk/boost/wave/grammars/cpp_expression_grammar.hpp	2008-07-10 09:42:18 EDT (Thu, 10 Jul 2008)
@@ -755,7 +755,10 @@
     parse_info<iterator_type> hit(first);
     closure_value result;             // expression result
     
-    try {
+#if !defined(BOOST_NO_EXCEPTIONS)
+    try 
+#endif
+    {
         expression_grammar g;             // expression grammar
         hit = parse (first, last, g[spirit_assign_actor(result)], 
                      ch_p(T_SPACE) | ch_p(T_CCOMMENT) | ch_p(T_CPPCOMMENT));
@@ -768,6 +771,7 @@
                     expression = "<empty expression>";
                 BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression, 
                     expression.c_str(), act_pos);
+                return false;
             }
             else {
             //  as the if_block_status is false no errors will be reported
@@ -775,17 +779,20 @@
             }
         }
     }
+#if !defined(BOOST_NO_EXCEPTIONS)
     catch (boost::wave::preprocess_exception const& e) {
     // expression is illformed
         if (if_block_status) {
             boost::throw_exception(e);
+            return false;
         }
-        else {
+        else         {
         //  as the if_block_status is false no errors will be reported
             return false;
         }
     }
-        
+#endif
+
     if (!hit.full) {
     // The token list starts with a valid expression, but there remains 
     // something. If the remainder consists out of whitespace only, the 
@@ -812,6 +819,7 @@
                         expression = "<empty expression>";
                     BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression, 
                         expression.c_str(), act_pos);
+                    return false;
                 }
                 else {
                 //  as the if_block_status is false no errors will be reported