Sync from upstream.

This commit is contained in:
Rene Rivera
2024-04-10 07:56:56 -05:00
5 changed files with 81 additions and 78 deletions

View File

@@ -116,24 +116,33 @@ jobs:
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:23.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10
os: ubuntu-latest
install: clang-17
- toolset: clang
cxxstd: "11,14,17,2a"
os: macos-11
@@ -227,7 +236,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -271,7 +280,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -319,7 +328,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -377,7 +386,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -430,7 +439,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -479,7 +488,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -546,7 +555,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd

View File

@@ -1,78 +1,68 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright (C) 2017, 2018 James E. King III
# Copyright 2016-2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
# When copying this to a new library, be sure to update the name of the library
# in two places (once each at the top of install: and test_script:)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- develop
- master
matrix:
allow_failures:
- MAYFAIL: true
- develop
- /feature\/.*/
environment:
global:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
# to use the default for a given environment, comment it out; recommend you build debug and release however..
# on Windows it is important to exercise all the possibilities, especially shared vs static
# B2_ADDRESS_MODEL: address-model=64,32
# B2_LINK: link=shared,static
# B2_THREADING: threading=multi,single
B2_VARIANT: variant=release,debug
CXXSTD: 03
matrix:
- FLAVOR: Visual Studio 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-14.0
CXXSTD: 14,latest
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
B2_ADDRESS_MODEL: address-model=64,32
- FLAVOR: Visual Studio 2013
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
TOOLSET: msvc-12.0
- FLAVOR: mingw32
ARCH: i686
B2_ADDRESS_MODEL: address-model=32
SCRIPT: ci\mingw.bat
- FLAVOR: mingw64
ARCH: x86_64
B2_ADDRESS_MODEL: address-model=64
SCRIPT: ci\mingw.bat
- FLAVOR: cygwin (64-bit)
ADDPATH: C:\cygwin64\bin;
B2_ADDRESS_MODEL: address-model=64
TOOLSET: gcc
MAYFAIL: true
- FLAVOR: cygwin (32-bit)
CXXSTD: 14,17,latest
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: clang-win
CXXSTD: 14,17,latest
ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: clang-win
CXXSTD: 14,17,20,latest
ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin\bin;
B2_ADDRESS_MODEL: address-model=32
TOOLSET: gcc
MAYFAIL: true
CXXSTD: 11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin64\bin;
TOOLSET: gcc
CXXSTD: 11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;
TOOLSET: gcc
CXXSTD: 11,14,17,2a
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
TOOLSET: gcc
CXXSTD: 11,14,17,2a
install:
- set SELF=program_options
- set BOOST_BRANCH=develop
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update -q --init tools/boostdep
- git submodule update -q --init tools/build
- git submodule update -q --init tools/inspect
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\%SELF%
- python tools/boostdep/depinst/depinst.py --include example %SELF%
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\program_options\
- python tools/boostdep/depinst/depinst.py program_options
- cmd /c bootstrap
- b2 headers
- b2 -d0 headers
build: off
test_script:
- set SELF=program_options
- PATH=%ADDPATH%%PATH%
- IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF% toolset=%TOOLSET% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
- b2 -j3 libs/program_options/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release

View File

@@ -121,7 +121,7 @@ namespace boost { namespace program_options {
/** gcc says that throw specification on dtor is loosened
* without this line
* */
BOOST_DEFAULTED_FUNCTION(~error_with_option_name() throw(), {})
BOOST_DEFAULTED_FUNCTION(~error_with_option_name() BOOST_NOEXCEPT_OR_NOTHROW, {})
//void dump() const
@@ -183,7 +183,7 @@ namespace boost { namespace program_options {
/** Creates the error_message on the fly
* Currently a thin wrapper for substitute_placeholders() */
virtual const char* what() const throw();
virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW;
protected:
/** Used to hold the error text returned by what() */
@@ -209,7 +209,7 @@ namespace boost { namespace program_options {
multiple_values()
: error_with_option_name("option '%canonical_option%' only takes a single argument"){}
BOOST_DEFAULTED_FUNCTION(~multiple_values() throw(), {})
BOOST_DEFAULTED_FUNCTION(~multiple_values() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
/** Class thrown when there are several occurrences of an
@@ -220,7 +220,7 @@ namespace boost { namespace program_options {
multiple_occurrences()
: error_with_option_name("option '%canonical_option%' cannot be specified more than once"){}
BOOST_DEFAULTED_FUNCTION(~multiple_occurrences() throw(), {})
BOOST_DEFAULTED_FUNCTION(~multiple_occurrences() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
@@ -233,7 +233,7 @@ namespace boost { namespace program_options {
{
}
BOOST_DEFAULTED_FUNCTION(~required_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~required_option() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
/** Base class of unparsable options,
@@ -258,7 +258,7 @@ namespace boost { namespace program_options {
/** Does NOT set option name, because no option name makes sense */
virtual void set_option_name(const std::string&) {}
BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name() throw(), {})
BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
@@ -270,7 +270,7 @@ namespace boost { namespace program_options {
{
}
BOOST_DEFAULTED_FUNCTION(~unknown_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~unknown_option() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
@@ -283,9 +283,9 @@ namespace boost { namespace program_options {
m_alternatives(xalternatives)
{}
BOOST_DEFAULTED_FUNCTION(~ambiguous_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~ambiguous_option() BOOST_NOEXCEPT_OR_NOTHROW, {})
const std::vector<std::string>& alternatives() const throw() {return m_alternatives;}
const std::vector<std::string>& alternatives() const BOOST_NOEXCEPT_OR_NOTHROW {return m_alternatives;}
protected:
/** Makes all substitutions using the template */
@@ -320,7 +320,7 @@ namespace boost { namespace program_options {
{
}
BOOST_DEFAULTED_FUNCTION(~invalid_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_syntax() BOOST_NOEXCEPT_OR_NOTHROW, {})
kind_t kind() const {return m_kind;}
@@ -340,7 +340,7 @@ namespace boost { namespace program_options {
m_substitutions["invalid_line"] = invalid_line;
}
BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax() BOOST_NOEXCEPT_OR_NOTHROW, {})
/** Convenience functions for backwards compatibility */
virtual std::string tokens() const {return m_substitutions.find("invalid_line")->second; }
@@ -355,7 +355,7 @@ namespace boost { namespace program_options {
const std::string& original_token = "",
int option_style = 0):
invalid_syntax(kind, option_name, original_token, option_style) {}
BOOST_DEFAULTED_FUNCTION(~invalid_command_line_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_command_line_syntax() BOOST_NOEXCEPT_OR_NOTHROW, {})
};
@@ -380,7 +380,7 @@ namespace boost { namespace program_options {
{
}
BOOST_DEFAULTED_FUNCTION(~validation_error() throw(), {})
BOOST_DEFAULTED_FUNCTION(~validation_error() BOOST_NOEXCEPT_OR_NOTHROW, {})
kind_t kind() const { return m_kind; }

View File

@@ -260,7 +260,7 @@ namespace boost { namespace program_options {
}
const char* error_with_option_name::what() const throw()
const char* error_with_option_name::what() const BOOST_NOEXCEPT_OR_NOTHROW
{
// will substitute tokens each time what is run()
substitute_placeholders(m_error_template);

View File

@@ -300,6 +300,10 @@ void test_config_file(const char* config_file)
check_value(a2[6], "m1.v3", "3");
}
#if defined(__CYGWIN__)
extern "C" int putenv (char *__string);
#endif
void test_environment()
{
options_description desc;
@@ -308,7 +312,7 @@ void test_environment()
("bar", new untyped_value, "")
;
#if (defined(_WIN32) && ! defined(BOOST_BORLANDC) && ! defined(BOOST_EMBTC)) || (defined(__CYGWIN__))
#if defined(_WIN32) && ! defined(BOOST_BORLANDC) && ! defined(BOOST_EMBTC)
_putenv("PO_TEST_FOO=1");
#else
putenv(const_cast<char*>("PO_TEST_FOO=1"));