|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79783 - in trunk: boost/wave/util libs/wave/test/testwave/testfiles
From: hartmut.kaiser_at_[hidden]
Date: 2012-07-28 10:08:10
Author: hkaiser
Date: 2012-07-28 10:08:09 EDT (Sat, 28 Jul 2012)
New Revision: 79783
URL: http://svn.boost.org/trac/boost/changeset/79783
Log:
Wave: Fixed an obscure problem when preprocessing directives wouldn't be recognized if the previous line contained nothing but an empty macro invocation (see new test case t_9_023.cpp)
Added:
trunk/libs/wave/test/testwave/testfiles/t_9_023.cpp (contents, props changed)
Text files modified:
trunk/boost/wave/util/cpp_iterator.hpp | 3 +++
trunk/libs/wave/test/testwave/testfiles/test.cfg | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
Modified: trunk/boost/wave/util/cpp_iterator.hpp
==============================================================================
--- trunk/boost/wave/util/cpp_iterator.hpp (original)
+++ trunk/boost/wave/util/cpp_iterator.hpp 2012-07-28 10:08:09 EDT (Sat, 28 Jul 2012)
@@ -515,6 +515,9 @@
act_token.set_value("\n");
}
+ if (IS_CATEGORY(id, EOLTokenType))
+ seen_newline = true;
+
} while (ctx.get_hooks().may_skip_whitespace(ctx.derived(), act_token, skipped_newline));
}
catch (boost::wave::cpplexer::lexing_exception const& e) {
Added: trunk/libs/wave/test/testwave/testfiles/t_9_023.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/wave/test/testwave/testfiles/t_9_023.cpp 2012-07-28 10:08:09 EDT (Sat, 28 Jul 2012)
@@ -0,0 +1,31 @@
+/*=============================================================================
+ Boost.Wave: A Standard compliant C++ preprocessor library
+ http://www.boost.org/
+
+ 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)
+=============================================================================*/
+
+// Verifies that preprocessing directives are properly recognized only if
+// the '#' is really the first character on a line before macro expansion.
+// See http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_144.html.
+
+#define _C_STD_BEGIN
+
+_C_STD_BEGIN
+#ifndef _M_CEE_PURE
+_C_LIB_DECL
+#endif
+
+//R #line 18 "t_9_023.cpp"
+//R _C_LIB_DECL
+
+//H 10: t_9_023.cpp(14): #define
+//H 08: t_9_023.cpp(14): _C_STD_BEGIN=
+//H 01: t_9_023.cpp(14): _C_STD_BEGIN
+//H 02:
+//H 03: _
+//H 10: t_9_023.cpp(17): #ifndef
+//H 11: t_9_023.cpp(17): #ifndef _M_CEE_PURE: 0
+//H 10: t_9_023.cpp(19): #endif
Modified: trunk/libs/wave/test/testwave/testfiles/test.cfg
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/test.cfg (original)
+++ trunk/libs/wave/test/testwave/testfiles/test.cfg 2012-07-28 10:08:09 EDT (Sat, 28 Jul 2012)
@@ -238,3 +238,4 @@
t_9_020.cpp
t_9_021.cpp
t_9_022.cpp
+t_9_023.cpp
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