2
0
mirror of https://github.com/boostorg/wave.git synced 2026-01-19 04:42:16 +00:00

Merge pull request #231 from boostorg/develop

Updates for 1.87
This commit is contained in:
Jeff Trull
2024-10-30 23:39:15 -07:00
committed by GitHub
27 changed files with 370 additions and 87 deletions

View File

@@ -1,5 +1,9 @@
name: GitHub Actions CI
# permit node16 use as a workaround for node20's differing glibc version
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
on:
pull_request:
push:
@@ -107,7 +111,7 @@ jobs:
sudo python3 get-pip.py
sudo /usr/local/bin/pip install cmake
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: linux
shell: bash
@@ -205,7 +209,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set DEVELOPER_DIR
if: matrix.xcode_version != ''

View File

@@ -18,6 +18,11 @@ TODO (known issues):
CHANGELOG
Boost V1.87:
- Fixed #220: Seg fault under C++20 and empty stringify parameter (thanks jwnhy)
- Fixed #222: No line directive if first line of included file is blank (thanks Nick Nobles)
- Misc build fixes: CI server update, deprecated headers, modular build
Boost V1.86:
- Fixed #197: Improper signed overflow handling (UB and a missing division check)
- Replaced usage of vsprintf() with the more secure vsnprintf()

43
build.jam Normal file
View File

@@ -0,0 +1,43 @@
# Copyright René Ferdinand Rivera Morell 2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/assert//boost_assert
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/core//boost_core
/boost/filesystem//boost_filesystem
/boost/format//boost_format
/boost/iterator//boost_iterator
/boost/lexical_cast//boost_lexical_cast
/boost/mpl//boost_mpl
/boost/multi_index//boost_multi_index
/boost/optional//boost_optional
/boost/pool//boost_pool
/boost/preprocessor//boost_preprocessor
/boost/serialization//boost_serialization
/boost/smart_ptr//boost_smart_ptr
/boost/spirit//boost_spirit
/boost/static_assert//boost_static_assert
/boost/throw_exception//boost_throw_exception
/boost/type_traits//boost_type_traits ;
project /boost/wave
: common-requirements
<include>include
;
explicit
[ alias boost_wave : build//boost_wave ]
[ alias wave : tool/build//wave ]
[ alias all : boost_wave wave samples test ]
;
call-if : boost-library wave
: install boost_wave
;

View File

@@ -4,13 +4,16 @@
#
# http://www.boost.org/
#
# Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
# Software License, Version 1.0. (See accompanying file
# Copyright (c) 2001-2011 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)
import ../../config/checks/config : requires ;
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
project boost/wave
project
: common-requirements <library>$(boost_dependencies)
: requirements
[ requires
cxx11_constexpr
@@ -25,6 +28,8 @@ project boost/wave
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
: source-location ../src
: usage-requirements
<define>BOOST_ALL_NO_LIB=1
;
SOURCES =
@@ -45,8 +50,8 @@ SOURCES =
lib boost_wave
:
$(SOURCES)
../../filesystem/build//boost_filesystem
../../thread/build//boost_thread
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
;
for local source in $(SOURCES)
@@ -69,5 +74,3 @@ for local source in $(SOURCES)
obj $(source) : $(source).cpp : $(requirements) ;
}
boost-install boost_wave ;

View File

@@ -23,7 +23,7 @@
#include <boost/throw_exception.hpp>
#include <boost/pool/singleton_pool.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/smart_ptr/detail/atomic_count.hpp>
#include <boost/optional.hpp>
// this must occur after all of the includes and before any code appears

View File

@@ -1578,9 +1578,9 @@ pp_iterator_functor<ContextT>::on_include_helper(char const* f, char const* s,
char const* current_name = 0; // never try to match current file name
#endif
// call the 'found_include_directive' hook function
// call the 'found_include_directive' hook function
if (ctx.get_hooks().found_include_directive(ctx.derived(), f, include_next))
return true; // client returned false: skip file to include
return true; // client returned true: skip file to include
file_path = util::impl::unescape_lit(file_path);
std::string native_path_str;
@@ -1607,6 +1607,7 @@ pp_iterator_functor<ContextT>::on_include_helper(char const* f, char const* s,
boost::wave::enable_prefer_pp_numbers(ctx.get_language()),
is_system ? base_iteration_context_type::system_header :
base_iteration_context_type::user_header));
new_iter_ctx->emitted_lines = (unsigned int)(-1); // force #line directive
// call the include policy trace function
ctx.get_hooks().opened_include_file(ctx.derived(), dir_path, file_path,

View File

@@ -1262,25 +1262,36 @@ macromap<ContextT>::expand_replacement_list(
else if (adjacent_stringize &&
!IS_CATEGORY(*cit, WhiteSpaceTokenType))
{
// stringize the current argument
BOOST_ASSERT(!arguments[i].empty());
// safe a copy of the first tokens position (not a reference!)
position_type pos((*arguments[i].begin()).get_position());
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (is_ellipsis && boost::wave::need_variadics(ctx.get_language())) {
impl::trim_sequence_left(arguments[i]);
impl::trim_sequence_right(arguments.back());
expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments, i, pos), pos));
}
#if BOOST_WAVE_SUPPORT_CPP2A != 0
if (i >= arguments.size()) {
// no argument supplied; do nothing (only c20 should reach here)
BOOST_ASSERT(boost::wave::need_cpp2a(ctx.get_language()));
position_type last_valid(arguments.back().back().get_position());
// insert a empty string
expanded.push_back(token_type(T_STRINGLIT, "\"\"", last_valid));
}
else
#endif
{
impl::trim_sequence(arguments[i]);
expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments[i], pos), pos));
// shouldn't be oob (w.o. cpp20)
BOOST_ASSERT(i < arguments.size() && !arguments[i].empty());
// safe a copy of the first tokens position (not a reference!)
position_type pos((*arguments[i].begin()).get_position());
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (is_ellipsis && boost::wave::need_variadics(ctx.get_language())) {
impl::trim_sequence_left(arguments[i]);
impl::trim_sequence_right(arguments.back());
expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments, i, pos), pos));
}
else
#endif
{
impl::trim_sequence(arguments[i]);
expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments[i], pos), pos));
}
}
adjacent_stringize = false;
}

View File

@@ -14,7 +14,7 @@
#include <vector>
#include <list>
#include <boost/detail/atomic_count.hpp>
#include <boost/smart_ptr/detail/atomic_count.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/wave/wave_config.hpp>

View File

@@ -3,6 +3,8 @@
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
project

View File

@@ -11,7 +11,7 @@
=============================================================================*/
#include "check_macro_naming.hpp"
#include "libs/filesystem/include/boost/filesystem/file_status.hpp"
#include "boost/filesystem/file_status.hpp"
///////////////////////////////////////////////////////////////////////////////
// Utilities from the rest of Boost

View File

@@ -4,27 +4,28 @@
#
# http://www.boost.org/
#
# Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
# Software License, Version 1.0. (See accompanying file
# Copyright (c) 2001-2010 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)
project : requirements <library>/boost/wave//boost_wave ;
SOURCES =
../cpp_tokens
../instantiate_cpp_exprgrammar
../instantiate_cpp_grammar
../cpp_tokens
../instantiate_cpp_exprgrammar
../instantiate_cpp_grammar
../instantiate_cpp_literalgrs
../instantiate_defined_grammar
../instantiate_has_include_grammar
../instantiate_slex_lexer
../instantiate_slex_lexer
;
exe cpp_tokens
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
;

View File

@@ -4,35 +4,39 @@
#
# http://www.boost.org/
#
# Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
# Software License, Version 1.0. (See accompanying file
# Copyright (c) 2001-2010 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)
SOURCES =
../list_includes
../instantiate_cpp_exprgrammar
../instantiate_cpp_grammar
../instantiate_cpp_exprgrammar
../instantiate_cpp_grammar
../instantiate_cpp_literalgrs
../instantiate_defined_grammar
../instantiate_has_include_grammar
../instantiate_lexertl_lexer
../instantiate_lexertl_lexer
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/filesystem//boost_filesystem
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
;
exe list_includes
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
;
for local source in $(SOURCES)
{
local requirements ;
# workaround for compiler bug
requirements += <toolset-msvc:version>7.1:<rtti>off ;
requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ;
requirements += <toolset-msvc:version>7.1:<rtti>off ;
requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ;
obj $(source) : $(source).cpp : $(requirements) ;
}

View File

@@ -4,26 +4,31 @@
#
# http://www.boost.org/
#
# Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
# Software License, Version 1.0. (See accompanying file
# Copyright (c) 2001-2010 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)
SOURCES =
../token_statistics
SOURCES =
../token_statistics
../instantiate_xlex_lexer
../instantiate_cpp_grammar
../instantiate_defined_grammar
../instantiate_has_include_grammar
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/filesystem//boost_filesystem
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
<library>/boost/xpressive//boost_xpressive
;
exe token_statistics
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
;
for local source in $(SOURCES)

View File

@@ -4,11 +4,11 @@
#
# http://www.boost.org/
#
# Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
# Software License, Version 1.0. (See accompanying file
# Copyright (c) 2001-2010 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)
SOURCES =
SOURCES =
../idl
../instantiate_cpp_grammar
../instantiate_defined_grammar
@@ -17,16 +17,20 @@ SOURCES =
../instantiate_re2c_lexer
../instantiate_re2c_lexer_str
../idllexer/idl_re
;
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
<library>/boost/filesystem//boost_filesystem
;
exe waveidl
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/system//boost_system
/boost/thread//boost_thread
/boost/filesystem//boost_filesystem
;
for local source in $(SOURCES)

View File

@@ -8,7 +8,11 @@
# Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
import project ;
import path ;
#
# These are the sources to compile for the testwave application
@@ -22,9 +26,23 @@ SOURCES_DYNAMIC = testwave_dll testwave_app_dll
SOURCES = $(SOURCE_STATIC) $(SOURCES_DYNAMIC)
;
path-constant TESTWAVE_DIR : $(BOOST_ROOT)/libs/wave/test/testwave/testfiles
path-constant TESTWAVE_DIR : ../testwave/testfiles
;
path-constant WAVE_INCLUDE_DIR : ../../include
;
path-constant SAMPLES_DIR : ../../samples
;
#
# We need the Boost Config project for the boost/version.hpp header file.
#
local boost-config-attributes
= [ project.attributes [ project.is-registered-id /boost/config ] ] ;
local BOOST_CONFIG_INCLUDE_DIR
= [ path.join [ $(boost-config-attributes).get location ] include ] ;
#
# This are the arguments for the testwave executable
#
@@ -32,7 +50,8 @@ TESTWAVE_ARGUMENTS =
-d4 # use -d4 for verbose results
--hooks=1 # test hooks as well
-S$(TESTWAVE_DIR)
-S$(BOOST_ROOT) -I$(BOOST_ROOT)
-S$(WAVE_INCLUDE_DIR) -I$(WAVE_INCLUDE_DIR)
-S$(BOOST_CONFIG_INCLUDE_DIR) -I$(BOOST_CONFIG_INCLUDE_DIR)
;
#
@@ -41,7 +60,7 @@ TESTWAVE_ARGUMENTS =
TESTWAVE_FILES = test.cfg
;
project wave/test
project
: requirements
[ requires
cxx11_constexpr
@@ -51,6 +70,7 @@ project wave/test
cxx11_hdr_mutex
cxx11_hdr_regex
]
<include>$(SAMPLES_DIR)
;
for local source in $(SOURCES)
@@ -58,6 +78,10 @@ for local source in $(SOURCES)
local requirements ;
requirements += <toolset-msvc:version>7.1:<rtti>off ; # workaround for compiler bug
requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ;
requirements +=
<source>/boost/any//boost_any
<source>/boost/program_options//boost_program_options
;
obj $(source) : ../testwave/$(source).cpp : $(requirements) ;
}
@@ -133,6 +157,7 @@ test-suite wave
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
/boost/system//boost_system
/boost/xpressive//boost_xpressive
:
# arguments
:
@@ -211,6 +236,7 @@ test-suite wave
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
/boost/system//boost_system
/boost/xpressive//boost_xpressive
:
# arguments
:

View File

@@ -24,7 +24,7 @@
// include the lexertl lexer related stuff
#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type
#include <libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp> // lexer type
#include <list_includes/lexertl/lexertl_lexer.hpp> // lexer type
typedef boost::wave::cpplexer::lex_token<> token_type;
typedef boost::wave::cpplexer::lexertl::lex_iterator<token_type> lexer_type;

View File

@@ -27,8 +27,8 @@
///////////////////////////////////////////////////////////////////////////////
// include the Slex lexer related stuff
#include <libs/wave/samples/cpp_tokens/slex_token.hpp> // token type
#include <libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp> // lexer type
#include <cpp_tokens/slex_token.hpp> // token type
#include <cpp_tokens/slex/cpp_slex_lexer.hpp> // lexer type
typedef boost::wave::cpplexer::slex_token<> token_type;
typedef boost::wave::cpplexer::slex::slex_iterator<token_type> lexer_type;

View File

@@ -26,8 +26,8 @@
///////////////////////////////////////////////////////////////////////////////
// include the Xpressive lexer related stuff
#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type
#include <libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp> // lexer type
#include <libs/wave/samples/token_statistics/xlex_iterator.hpp> // iterator
#include <token_statistics/xlex/xlex_lexer.hpp> // lexer type
#include <token_statistics/xlex_iterator.hpp> // iterator
typedef boost::wave::cpplexer::lex_token<> token_type;
typedef boost::wave::cpplexer::xlex::xlex_iterator<token_type> lexer_type;

View File

@@ -0,0 +1,74 @@
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Nick Nobles. 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)
=============================================================================*/
// Line directives should be emitted for included files when they begin
// with a single #if/#ifdef/#define directive. Addresses github issue #222.
#include "t_5_040_001.hpp" // #if as first line should emit line directive
#include "t_5_040_002.hpp" // #define as first line should emit line directive
#include "t_5_040_003.hpp" // ensure nested includes emit line directive
#include "t_5_040_005.hpp" // ensure empty initial lines produce line directive
t_5_040_a
#if 1
t_5_040_b
#endif
//R #line 2 "t_5_040_001.hpp"
//R t_5_040_001a
//R #line 6 "t_5_040_001.hpp"
//R t_5_040_001b
//R
//R t_5_040_001c
//R #line 2 "t_5_040_002.hpp"
//R t_5_040_002
//R #line 2 "t_5_040_004.hpp"
//R t_5_040_004
//R #line 2 "t_5_040_003.hpp"
//R t_5_040_003
//R #line 15 "t_5_040_005.hpp"
//R t_5_040_005
//R #line 17 "t_5_040.cpp"
//R t_5_040_a
//R
//R t_5_040_b
//H 10: t_5_040.cpp(12): #include "t_5_040_001.hpp"
//H 04: "t_5_040_001.hpp"
//H 05: $S(t_5_040_001.hpp) ($B(t_5_040_001.hpp))
//H 10: t_5_040_001.hpp(1): #if
//H 11: t_5_040_001.hpp(1): #if 1: 1
//H 10: t_5_040_001.hpp(3): #endif
//H 10: t_5_040_001.hpp(7): #if
//H 11: t_5_040_001.hpp(7): #if 1: 1
//H 10: t_5_040_001.hpp(9): #endif
//H 06:
//H 10: t_5_040.cpp(13): #include "t_5_040_002.hpp"
//H 04: "t_5_040_002.hpp"
//H 05: t_5_040_002.hpp ($B(t_5_040_002.hpp))
//H 10: t_5_040_002.hpp(1): #define
//H 08: t_5_040_002.hpp(1): t_5_040_002_hpp=
//H 06:
//H 10: t_5_040.cpp(14): #include "t_5_040_003.hpp"
//H 04: "t_5_040_003.hpp"
//H 05: t_5_040_003.hpp ($B(t_5_040_003.hpp))
//H 10: t_5_040_003.hpp(1): #include "t_5_040_004.hpp"
//H 04: "t_5_040_004.hpp"
//H 05: t_5_040_004.hpp ($B(t_5_040_004.hpp))
//H 10: t_5_040_004.hpp(1): #if
//H 11: t_5_040_004.hpp(1): #if 1: 1
//H 10: t_5_040_004.hpp(3): #endif
//H 06:
//H 06:
//H 10: t_5_040.cpp(15): #include "t_5_040_005.hpp"
//H 04: "t_5_040_005.hpp"
//H 05: t_5_040_005.hpp ($B(t_5_040_005.hpp))
//H 06:
//H 10: t_5_040.cpp(18): #if
//H 11: t_5_040.cpp(18): #if 1: 1
//H 10: t_5_040.cpp(20): #endif

View File

@@ -0,0 +1,22 @@
#if 1
t_5_040_001a
#endif
//Ensure line directive still properly gets replaced with empty line
t_5_040_001b
#if 1
t_5_040_001c
#endif
// Important: The #if must be the first line of this file to ensure proper testing
// of line directive emission. Do not move the copyright comment to the
// beginning of this file.
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Nick Nobles. 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)
=============================================================================*/

View File

@@ -0,0 +1,15 @@
#define t_5_040_002_hpp
t_5_040_002
// Important: The #define must be the first line of this file to ensure proper testing
// of line directive emission. Do not move the copyright comment to the
// beginning of this file.
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Nick Nobles. 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)
=============================================================================*/

View File

@@ -0,0 +1,15 @@
#include "t_5_040_004.hpp"
t_5_040_003
// Important: The #include must be the first line of this file to ensure proper testing
// of line directive emission. Do not move the copyright comment to the
// beginning of this file.
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Nick Nobles. 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)
=============================================================================*/

View File

@@ -0,0 +1,16 @@
#if 1
t_5_040_004
#endif
// Important: The #if must be the first line of this file to ensure proper testing
// of line directive emission. Do not move the copyright comment to the
// beginning of this file.
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Nick Nobles. 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)
=============================================================================*/

View File

@@ -0,0 +1,15 @@
// Important: The first line of this file must be blank to ensure proper testing
// of line directive emission. Do not move the copyright comment to the
// beginning of this file.
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2024 Jeff Trull. 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)
=============================================================================*/
t_5_040_005

View File

@@ -22,3 +22,18 @@ sizedvec(int, foo, 12);
//R #line 24 "t_8_004.cpp"
//R std::vector<double> bar( 3 , 42.0);
sizedvec(double, bar, 3, 42.0);
// test omitting trailing comma when expanding a macro with both variadic and
// non-variadic parameters where no variadic parameters are supplied
// (allowed starting in C++20)
#define MACRO1(x, ...) x -> __VA_ARGS__
#define MACRO2(x, ...) #x#__VA_ARGS__
#define MACRO3(x, ...) x##__VA_ARGS__
//R #line 34 "t_8_004.cpp"
MACRO1(1,) //R 1 ->
MACRO2(1,) //R "1"""
MACRO3(1,) //R 1
MACRO1(1) //R 1 ->
MACRO2(1) //R "1"""
MACRO3(1) //R 1

View File

@@ -146,6 +146,7 @@ t_5_036.cpp
t_5_037.cpp
t_5_038.cpp
t_5_039.cpp
t_5_040.cpp
#
# unit tests from the mcpp preprocessor validation suite

View File

@@ -34,13 +34,14 @@ project
exe wave
:
../cpp.cpp
/boost//wave
/boost//program_options
/boost//filesystem
/boost//serialization
/boost//system
/boost//thread
/boost/wave//boost_wave
/boost/program_options//boost_program_options
/boost/filesystem//boost_filesystem
/boost/serialization//boost_serialization
/boost/system//boost_system
/boost/thread//boost_thread
/boost/timer//boost_timer/<link>static
/boost/foreach//boost_foreach
:
<threading>multi
# <debug-symbols>on
@@ -49,8 +50,8 @@ exe wave
release
;
local bindir = [ option.get bindir : ../../../dist/bin ] ;
local libdir = [ option.get libdir : ../../../dist/lib ] ;
local bindir = [ option.get bindir : ../dist/bin ] ;
local libdir = [ option.get libdir : ../dist/lib ] ;
install dist-bin
: