diff --git a/include/boost/wave/cpplexer/cpp_lex_token.hpp b/include/boost/wave/cpplexer/cpp_lex_token.hpp index 349c4be..5ff6415 100644 --- a/include/boost/wave/cpplexer/cpp_lex_token.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_token.hpp @@ -21,6 +21,7 @@ #include #include +#include #include // this must occur after all of the includes and before any code appears @@ -147,7 +148,7 @@ token_data::operator new(std::size_t size) void *ret = pool_type::malloc(); if (0 == ret) - throw std::bad_alloc(); + boost::throw_exception(std::bad_alloc()); return ret; } diff --git a/include/boost/wave/grammars/cpp_expression_grammar.hpp b/include/boost/wave/grammars/cpp_expression_grammar.hpp index a6cf89d..eb5151f 100644 --- a/include/boost/wave/grammars/cpp_expression_grammar.hpp +++ b/include/boost/wave/grammars/cpp_expression_grammar.hpp @@ -755,7 +755,10 @@ expression_grammar_gen::evaluate( parse_info 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_grammar_gen::evaluate( 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 @@ expression_grammar_gen::evaluate( } } } +#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_grammar_gen::evaluate( 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 diff --git a/include/boost/wave/util/cpp_include_paths.hpp b/include/boost/wave/util/cpp_include_paths.hpp index d633870..dcb4344 100644 --- a/include/boost/wave/util/cpp_include_paths.hpp +++ b/include/boost/wave/util/cpp_include_paths.hpp @@ -115,15 +115,15 @@ struct load_filepos // // Any directories specified with the 'add_include_path()' function before // the function 'set_sys_include_delimiter()' is called are searched only -// for the case of '#include "file"' directives, they are not searched for -// '#include ' directives. If additional directories are specified +// for the case of '#include "file"' directives, they are not searched for +// '#include ' directives. If additional directories are specified // with the 'add_include_path()' function after a call to the function // 'set_sys_include_delimiter()', these directories are searched for all // '#include' directives. // // In addition, a call to the function 'set_sys_include_delimiter()' // inhibits the use of the current directory as the first search directory -// for '#include "file"' directives. Therefore, the current directory is +// for '#include "file"' directives. Therefore, the current directory is // searched only if it is requested explicitly with a call to the function // 'add_include_path(".")'. // diff --git a/include/boost/wave/util/cpp_macromap.hpp b/include/boost/wave/util/cpp_macromap.hpp index c71c0ea..8ec9e91 100644 --- a/include/boost/wave/util/cpp_macromap.hpp +++ b/include/boost/wave/util/cpp_macromap.hpp @@ -762,7 +762,7 @@ token_type startof_argument_list = *next; #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 if (boost::wave::need_variadics(ctx.get_language())) { // store a placemarker as the argument - argument->push_back(token_type(T_PLACEMARKER, "\xA7", // "§", + argument->push_back(token_type(T_PLACEMARKER, "\xA7", (*next).get_position())); ++count_arguments; } @@ -787,7 +787,7 @@ token_type startof_argument_list = *next; #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 if (boost::wave::need_variadics(ctx.get_language())) { // store a placemarker as the argument - argument->push_back(token_type(T_PLACEMARKER, "\xA7", // "§", + argument->push_back(token_type(T_PLACEMARKER, "\xA7", (*next).get_position())); ++count_arguments; } diff --git a/include/boost/wave/util/macro_helpers.hpp b/include/boost/wave/util/macro_helpers.hpp index bd883cb..adb3ea5 100644 --- a/include/boost/wave/util/macro_helpers.hpp +++ b/include/boost/wave/util/macro_helpers.hpp @@ -112,7 +112,7 @@ namespace impl { if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) { if (!was_whitespace) { // C++ standard 16.3.2.2 [cpp.stringize] - // Each occurrence of white space between the argument’s + // Each occurrence of white space between the argument's // preprocessing tokens becomes a single space character in the // character string literal. result += " "; @@ -126,7 +126,7 @@ namespace impl { } else #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 - if (T_PLACEMARKER != id) + if (T_PLACEMARKER != id) #endif { // now append this token to the string @@ -169,7 +169,7 @@ namespace impl { if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) { if (!was_whitespace) { // C++ standard 16.3.2.2 [cpp.stringize] - // Each occurrence of white space between the argument’s + // Each occurrence of white space between the argument's // preprocessing tokens becomes a single space character in the // character string literal. result += " "; diff --git a/test/testwave/testfiles/t_1_034.cpp b/test/testwave/testfiles/t_1_034.cpp index 138c680..3ea810f 100644 --- a/test/testwave/testfiles/t_1_034.cpp +++ b/test/testwave/testfiles/t_1_034.cpp @@ -35,3 +35,5 @@ STR() //R "" //H 00: t_1_034.cpp(21): STR(§), [t_1_034.cpp(16): STR(...)=#__VA_ARGS__] //H 02: "" //H 03: "" + +// boostinspect:noascii this file needs to contain non-ASCII characters diff --git a/test/testwave/testfiles/t_1_035.cpp b/test/testwave/testfiles/t_1_035.cpp index 632848d..4105170 100644 --- a/test/testwave/testfiles/t_1_035.cpp +++ b/test/testwave/testfiles/t_1_035.cpp @@ -45,3 +45,5 @@ PASTE2(1, , , 4) //R 14 //H 00: t_1_035.cpp(24): PASTE2(1, §, §, 4), [t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d] //H 02: 14 //H 03: 14 + +// boostinspect:noascii this file needs to contain non-ASCII characters