diff --git a/.travis.yml b/.travis.yml index ae6c5e50..060a16aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,18 +4,11 @@ language: cpp -sudo: false - -python: "2.7" - -os: - - linux - - osx - branches: only: - master - develop + - /feature\/.*/ env: matrix: @@ -27,6 +20,20 @@ matrix: - env: BOGUS_JOB=true include: + - os: linux + env: TEST_CMAKE=true # variables unused - just for identification in travis ci gui + script: + - mkdir __build__ && cd __build__ + - cmake .. -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON + - cmake --build . + + - os: linux + env: TEST_CMAKE=true BUILD_SHARED_LIBS=On # variables unused - just for identification in travis ci gui + script: + - mkdir __build__ && cd __build__ + - cmake .. -DBUILD_SHARED_LIBS=ON -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON + - cmake --build . + - os: linux env: TOOLSET=gcc COMPILER=g++ CXXSTD=03 @@ -102,6 +109,42 @@ matrix: sources: - ubuntu-toolchain-r-test + - os: linux + env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11 CXXSTD_DIALECT=cxxstd-dialect=gnu + addons: + apt: + packages: + - g++-7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu + addons: + apt: + packages: + - g++-7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11 CXXSTD_DIALECT=cxxstd-dialect=gnu + addons: + apt: + packages: + - g++-8 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu + addons: + apt: + packages: + - g++-8 + sources: + - ubuntu-toolchain-r-test + - os: linux env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 @@ -205,58 +248,27 @@ matrix: - os: osx env: TOOLSET=clang COMPILER=clang++ CXXSTD=11 osx_image: xcode6.4 + # On this image, git doesn't support --jobs 3 + install: + - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true + - cd .. + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/boostdep + - cp -r $TRAVIS_BUILD_DIR/* libs/regex + - python tools/boostdep/depinst/depinst.py -I example regex + - ./bootstrap.sh + - ./b2 headers + install: + - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true - cd .. - - git clone -b $TRAVIS_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 --init tools/build - - git submodule update --init libs/config - - git submodule update --init libs/core - - git submodule update --init libs/container_hash - - git submodule update --init libs/detail - - git submodule update --init libs/smart_ptr - - git submodule update --init libs/predef - - git submodule update --init libs/assert - - git submodule update --init libs/throw_exception - - git submodule update --init libs/mpl - - git submodule update --init libs/type_traits - - git submodule update --init libs/static_assert - - git submodule update --init libs/integer - - git submodule update --init libs/preprocessor - - git submodule update --init libs/functional - - git submodule update --init libs/program_options - - git submodule update --init libs/chrono - - git submodule update --init libs/system - - git submodule update --init libs/thread - - git submodule update --init libs/winapi - - git submodule update --init libs/move - - git submodule update --init libs/date_time - - git submodule update --init libs/ratio - - git submodule update --init libs/iterator - - git submodule update --init libs/range - - git submodule update --init libs/any - - git submodule update --init libs/concept_check - - git submodule update --init libs/array - - git submodule update --init libs/timer - - git submodule update --init libs/bind - - git submodule update --init libs/utility - - git submodule update --init libs/io - - git submodule update --init libs/intrusive - - git submodule update --init libs/container - - git submodule update --init libs/tuple - - git submodule update --init libs/exception - - git submodule update --init libs/function - - git submodule update --init libs/type_index - - git submodule update --init libs/lexical_cast - - git submodule update --init libs/numeric - - git submodule update --init libs/math - - git submodule update --init libs/tokenizer - - git submodule update --init libs/optional - - git submodule update --init libs/atomic - - git submodule update --init libs/rational - - git submodule update --init libs/algorithm + - git submodule update --init tools/boostdep - cp -r $TRAVIS_BUILD_DIR/* libs/regex + - python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex - ./bootstrap.sh - ./b2 headers diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..a61ba77c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,103 @@ +# Copyright 2018-2019 Mike Dev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt +# +# NOTE: CMake support for Boost.Regex is currently experimental at best +# and the interface is likely to change in the future + + +##### How-To: +# +# If you have a cmake project that wants to use and compile +# boost_regex, as part of a single build system run, do the following: +# 1) clone the boost project and all its sub-projects: +# +# git clone --branch develop --depth 1 --recursive --shallow-submodules https://github.com/boostorg/boost.git boost-root +# +# 2) add to your cmake script: +# +# add_subdirectory( []) +# target_link_libraries( PUBLIC Boost::regex) +# +# 3) run your cmake build as usual +# +# ## Explanation: +# +# Currently this file does not work standalone. It is expected to be +# invoked from a parent script via add_subdirectory. That parent script +# is responsible for providing targets for direct and indirect dependencies, +# such as Boost::assert, Boost::concept_check, e.g. by also adding those +# libraries via add_submodule (order doesn't matter). +# The parent script can be your own cmake script, but it is easier to just +# use add the CMakeLists in the root of the boost super project, which +# will in turn add all boost libraries usable with the add_subdirectory +# Workflow. +# +# Note: You don't need to actually clone all boost libraries. E.g. look +# into the travis ci file to see on which libraries boost_regex actually +# depends or use boostdep https://github.com/boostorg/boostdep + + +##### Current Limitations: +# +# - Doesn't compile or run tests +# + +cmake_minimum_required( VERSION 3.5...3.16 ) +project( boost_regex VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) + +option( BOOST_REGEX_INCLUDE_EXAMPLES "Also build (some) boost regex examples" OFF ) +option( BOOST_REGEX_USE_ICU "Enable ICU support in boost regex" OFF ) + +file( GLOB BOOST_REGEX_SRC ./src/*.cpp ) + +add_library( boost_regex ${BOOST_REGEX_SRC} ) +add_library( Boost::regex ALIAS boost_regex ) + +target_include_directories( boost_regex PUBLIC include ) + +target_compile_definitions( boost_regex + PUBLIC + # No need for autolink + BOOST_REGEX_NO_LIB + $<$,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1> + $<$,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1> +) + +# Specify dependencies (including header-only libraries) +target_link_libraries( boost_regex + PUBLIC + Boost::assert + Boost::concept_check + Boost::config + Boost::container_hash + Boost::core + Boost::integer + Boost::iterator + Boost::mpl + Boost::predef + Boost::smart_ptr + Boost::static_assert + Boost::throw_exception + Boost::type_traits +) + +if( BOOST_REGEX_USE_ICU ) + # ICU Targets could be provided by parent project, + # if not, look for them ourselves + if( NOT TARGET ICU::dt ) + # components need to be listed explicitly + find_package( ICU COMPONENTS dt in uc REQUIRED ) + endif() + + target_link_libraries( boost_regex + PRIVATE + ICU::dt ICU::in ICU::uc + ) + target_compile_definitions( boost_regex PRIVATE BOOST_HAS_ICU=1 ) +endif() + +if( BOOST_REGEX_INCLUDE_EXAMPLES ) + add_subdirectory( example/snippets ) +endif() + diff --git a/README.md b/README.md new file mode 100644 index 00000000..2c03881d --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +Boost Regex Library +============================ + +The Boost Regex library provides regular expression support for C++, this library is the ancestor to std::regex and still goes beyond +and offers some advantages to, the standard version. + +The full documentation is available on [boost.org](http://www.boost.org/doc/libs/release/libs/regex/index.html). + +## Support, bugs and feature requests ## + +Bugs and feature requests can be reported through the [Gitub issue tracker](https://github.com/boostorg/regex/issues) +(see [open issues](https://github.com/boostorg/regex/issues) and +[closed issues](https://github.com/boostorg/regex/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed)). + +You can submit your changes through a [pull request](https://github.com/boostorg/regex/pulls). + +There is no mailing-list specific to Boost Regex, although you can use the general-purpose Boost [mailing-list](http://lists.boost.org/mailman/listinfo.cgi/boost-users) using the tag [regex]. + + +## Development ## + +Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)): + + git clone https://github.com/boostorg/boost + cd boost + git submodule update --init + +The Boost Regex Library is located in `libs/regex/`. + +### Running tests ### +First, make sure you are in `libs/regex/test`. +You can either run all the tests listed in `Jamfile.v2` or run a single test: + + ../../../b2 <- run all tests + ../../../b2 regex_regress <- single test + diff --git a/appveyor.yml b/appveyor.yml index b131adcd..8ab4c68c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,13 +23,15 @@ environment: - ARGS: --toolset=msvc-14.0 address-model=32 - ARGS: --toolset=msvc-12.0 address-model=64 - ARGS: --toolset=msvc-14.0 address-model=64 - - ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest + - ARGS: --toolset=msvc-14.0 address-model=64 cxxstd=latest - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARGS: --toolset=msvc-14.1 address-model=64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARGS: --toolset=msvc-14.1 address-model=32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest + ARGS: --toolset=msvc-14.1 address-model=64 cxxstd=17 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 cxxstd=latest cxxflags=-permissive- - ARGS: --toolset=gcc address-model=64 PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH% - ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z @@ -38,13 +40,18 @@ environment: PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH% - ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition PATH: C:\MinGW\bin;%PATH% - + - ARGS: --toolset=gcc address-model=32 define=_POSIX_C_SOURCE=200112L threadapi=pthread link=static + PATH: C:\cygwin\bin;%PATH% + - ARGS: --toolset=gcc address-model=64 define=_POSIX_C_SOURCE=200112L define=__USE_ISOC99 threadapi=pthread link=static + PATH: C:\cygwin64\bin;%PATH% install: - cd .. - git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - git submodule update --init tools/build + - git submodule update --init tools/boost_install + - git submodule update --init libs/headers - git submodule update --init libs/config - git submodule update --init libs/core - git submodule update --init libs/container_hash diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 58fd1fbf..e4de0afd 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -5,6 +5,7 @@ import modules ; import testing ; +import errors ; project : requirements # default to all warnings on: @@ -32,19 +33,31 @@ rule path_options ( properties * ) # if ! $(disable-icu) { + if [ modules.peek : ICU_LINK ] + { + errors.user-error : "The ICU_LINK option is no longer supported by the Boost.Regex build - please refer to the documentation for equivalent options" ; + } if [ modules.peek : ICU_PATH ] { ICU_PATH = [ modules.peek : ICU_PATH ] ; } - if [ modules.peek : ICU_LINK ] + if [ modules.peek : ICU_ICUUC_NAME ] { - ICU_LINK = [ modules.peek : ICU_LINK ] ; + ICU_ICUUC_NAME = [ modules.peek : ICU_ICUUC_NAME ] ; + } + if [ modules.peek : ICU_ICUDT_NAME ] + { + ICU_ICUDT_NAME = [ modules.peek : ICU_ICUDT_NAME ] ; + } + if [ modules.peek : ICU_ICUIN_NAME ] + { + ICU_ICUIN_NAME = [ modules.peek : ICU_ICUIN_NAME ] ; } - if $(ICU_LINK) + if $(ICU_ICUUC_NAME) { - ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin BOOST_HAS_ICU=1 shared ; + lib icuuc : : $(ICU_ICUUC_NAME) ; } else { @@ -55,7 +68,13 @@ if ! $(disable-icu) lib icuuc : : msvc debug sicuucd static @path_options ; lib icuuc : : intel windows debug sicuucd static @path_options ; lib icuuc : : this_is_an_invalid_library_name ; - + } + if $(ICU_ICUDT_NAME) + { + lib icudt : : $(ICU_ICUDT_NAME) ; + } + else + { lib icudt : : icudata shared @path_options ; lib icudt : : icudt msvc shared @path_options ; lib icudt : : icudt intel windows shared @path_options ; @@ -63,7 +82,13 @@ if ! $(disable-icu) lib icudt : : sicudt msvc static @path_options ; lib icudt : : sicudt intel windows static @path_options ; lib icudt : : this_is_an_invalid_library_name ; - + } + if $(ICU_ICUIN_NAME) + { + lib icuin : : $(ICU_ICUIN_NAME) ; + } + else + { lib icuin : : icui18n shared @path_options ; lib icuin : : msvc debug icuind shared @path_options ; lib icuin : : msvc icuin shared @path_options ; @@ -75,23 +100,23 @@ if ! $(disable-icu) lib icuin : : intel windows debug sicuind static @path_options ; lib icuin : : intel windows sicuin static @path_options ; lib icuin : : this_is_an_invalid_library_name ; - - ICU_OPTS = - $(ICU_PATH)/include - shared:icuuc/shared - shared:icudt/shared - shared:icuin/shared - static:icuuc - static:icudt - static:icuin - BOOST_HAS_ICU=1 - static:U_STATIC_IMPLEMENTATION=1 - ; } + ICU_OPTS = + $(ICU_PATH)/include + shared:icuuc/shared + shared:icudt/shared + shared:icuin/shared + static:icuuc + static:icudt + static:icuin + BOOST_HAS_ICU=1 + static:U_STATIC_IMPLEMENTATION=1 + ; + } -unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ; +exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ; explicit has_icu ; alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ; diff --git a/doc/history.qbk b/doc/history.qbk index 85319026..be64bb13 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -8,12 +8,15 @@ [section:history History] -New issues should be submitted at [@http://svn.boost.org svn.boost.org] - don't forget to include your -email address in the ticket! +New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues] -Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here]. +Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here]. -All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here]. +All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here]. + +[h4 Boost.Regex-5.1.4 (Boost-172.0)] + +* Minor build fixes, see [@https://github.com/boostorg/regex/issues/89 #89]. [h4 Boost.Regex-5.1.3 (Boost-1.64.0)] diff --git a/doc/html/boost_regex/background.html b/doc/html/boost_regex/background.html index 997628ff..74e1dcd4 100644 --- a/doc/html/boost_regex/background.html +++ b/doc/html/boost_regex/background.html @@ -3,9 +3,9 @@ Background Information - - - + + + @@ -26,7 +26,7 @@ -
+
Headers
Localization
Thread Safety
diff --git a/doc/html/boost_regex/background/acknowledgements.html b/doc/html/boost_regex/background/acknowledgements.html index 9d8c6621..f09b00f8 100644 --- a/doc/html/boost_regex/background/acknowledgements.html +++ b/doc/html/boost_regex/background/acknowledgements.html @@ -3,8 +3,8 @@ Acknowledgements - - + + diff --git a/doc/html/boost_regex/background/examples.html b/doc/html/boost_regex/background/examples.html index fec2107f..936d24ac 100644 --- a/doc/html/boost_regex/background/examples.html +++ b/doc/html/boost_regex/background/examples.html @@ -3,8 +3,8 @@ Test and Example Programs - - + + diff --git a/doc/html/boost_regex/background/faq.html b/doc/html/boost_regex/background/faq.html index 620cecd0..564a9168 100644 --- a/doc/html/boost_regex/background/faq.html +++ b/doc/html/boost_regex/background/faq.html @@ -3,8 +3,8 @@ FAQ - - + + diff --git a/doc/html/boost_regex/background/futher.html b/doc/html/boost_regex/background/futher.html index 5212784c..6a95ede5 100644 --- a/doc/html/boost_regex/background/futher.html +++ b/doc/html/boost_regex/background/futher.html @@ -3,8 +3,8 @@ References and Further Information - - + + diff --git a/doc/html/boost_regex/background/headers.html b/doc/html/boost_regex/background/headers.html index caa5646b..ebc299e7 100644 --- a/doc/html/boost_regex/background/headers.html +++ b/doc/html/boost_regex/background/headers.html @@ -3,8 +3,8 @@ Headers - - + + diff --git a/doc/html/boost_regex/background/history.html b/doc/html/boost_regex/background/history.html index f65dc59f..4ae83ecb 100644 --- a/doc/html/boost_regex/background/history.html +++ b/doc/html/boost_regex/background/history.html @@ -3,8 +3,8 @@ History - - + + @@ -37,6 +37,14 @@

+ Boost.Regex-5.1.4 + (Boost-172.0) +
+
  • + Minor build fixes, see #89. +
+
+ Boost.Regex-5.1.3 (Boost-1.64.0)
@@ -50,7 +58,7 @@
- + Boost.Regex-5.1.2 (Boost-1.62.0)
@@ -71,7 +79,7 @@
- + Boost.Regex-5.1.1 (Boost-1.61.0)
@@ -79,7 +87,7 @@ Change to lockfree implementation of memory cache, see PR#23.
- + Boost.Regex-5.1.0 (Boost-1.60.0)
@@ -102,7 +110,7 @@
- + Boost.Regex-5.0.1 (Boost-1.58.0)
@@ -135,7 +143,7 @@
- + Boost.Regex-5.0.0 (Boost-1.56.0)
@@ -168,14 +176,14 @@
- + Boost-1.54

Fixed issue #8569.

- + Boost-1.53

@@ -183,7 +191,7 @@ #7644.

- + Boost-1.51

@@ -193,7 +201,7 @@ #6346.

- + Boost-1.50

@@ -202,7 +210,7 @@ expression.

- + Boost-1.48

@@ -212,7 +220,7 @@ #5736.

- + Boost 1.47
@@ -225,7 +233,7 @@ #5504.

- + Boost 1.44
@@ -244,7 +252,7 @@ #3890

- + Boost 1.42
@@ -273,7 +281,7 @@
- + Boost 1.40
@@ -282,7 +290,7 @@ branch resets and recursive regular expressions.
- + Boost 1.38
@@ -310,7 +318,7 @@
- + Boost 1.34
@@ -333,7 +341,7 @@
- + Boost 1.33.1
@@ -403,7 +411,7 @@
- + Boost 1.33.0
@@ -458,7 +466,7 @@
- + Boost 1.32.1
@@ -466,7 +474,7 @@ Fixed bug in partial matches of bounded repeats of '.'.
- + Boost 1.31.0
diff --git a/doc/html/boost_regex/background/locale.html b/doc/html/boost_regex/background/locale.html index 97d08859..7662a36f 100644 --- a/doc/html/boost_regex/background/locale.html +++ b/doc/html/boost_regex/background/locale.html @@ -3,8 +3,8 @@ Localization - - + + diff --git a/doc/html/boost_regex/background/performance.html b/doc/html/boost_regex/background/performance.html index 29d710d1..4e760d85 100644 --- a/doc/html/boost_regex/background/performance.html +++ b/doc/html/boost_regex/background/performance.html @@ -3,8 +3,8 @@ Performance - - + + @@ -26,7 +26,7 @@ -
+
Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)
diff --git a/doc/html/boost_regex/background/performance/section_id1378460593.html b/doc/html/boost_regex/background/performance/section_id1378460593.html index f4389702..478afd94 100644 --- a/doc/html/boost_regex/background/performance/section_id1378460593.html +++ b/doc/html/boost_regex/background/performance/section_id1378460593.html @@ -3,8 +3,8 @@ Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id1675827111.html b/doc/html/boost_regex/background/performance/section_id1675827111.html index b98f7d53..e653eb86 100644 --- a/doc/html/boost_regex/background/performance/section_id1675827111.html +++ b/doc/html/boost_regex/background/performance/section_id1675827111.html @@ -3,8 +3,8 @@ Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id3141719723.html b/doc/html/boost_regex/background/performance/section_id3141719723.html index ef4d9d46..808041b4 100644 --- a/doc/html/boost_regex/background/performance/section_id3141719723.html +++ b/doc/html/boost_regex/background/performance/section_id3141719723.html @@ -3,8 +3,8 @@ Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id3258595385.html b/doc/html/boost_regex/background/performance/section_id3258595385.html index 646ebbfe..52eae570 100644 --- a/doc/html/boost_regex/background/performance/section_id3258595385.html +++ b/doc/html/boost_regex/background/performance/section_id3258595385.html @@ -3,8 +3,8 @@ Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id3261825021.html b/doc/html/boost_regex/background/performance/section_id3261825021.html index 39849278..6c47d185 100644 --- a/doc/html/boost_regex/background/performance/section_id3261825021.html +++ b/doc/html/boost_regex/background/performance/section_id3261825021.html @@ -3,8 +3,8 @@ Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id3752650613.html b/doc/html/boost_regex/background/performance/section_id3752650613.html index 1e56bbee..de354edd 100644 --- a/doc/html/boost_regex/background/performance/section_id3752650613.html +++ b/doc/html/boost_regex/background/performance/section_id3752650613.html @@ -3,8 +3,8 @@ Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id4128344975.html b/doc/html/boost_regex/background/performance/section_id4128344975.html index ade97ae0..fcbb3838 100644 --- a/doc/html/boost_regex/background/performance/section_id4128344975.html +++ b/doc/html/boost_regex/background/performance/section_id4128344975.html @@ -3,8 +3,8 @@ Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1) - - + + diff --git a/doc/html/boost_regex/background/performance/section_id4148872883.html b/doc/html/boost_regex/background/performance/section_id4148872883.html index 5e9330d1..0c37acaf 100644 --- a/doc/html/boost_regex/background/performance/section_id4148872883.html +++ b/doc/html/boost_regex/background/performance/section_id4148872883.html @@ -3,8 +3,8 @@ Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0) - - + + diff --git a/doc/html/boost_regex/background/redist.html b/doc/html/boost_regex/background/redist.html index e5e84e08..656723cb 100644 --- a/doc/html/boost_regex/background/redist.html +++ b/doc/html/boost_regex/background/redist.html @@ -3,8 +3,8 @@ Redistributables - - + + diff --git a/doc/html/boost_regex/background/standards.html b/doc/html/boost_regex/background/standards.html index 43481c33..050f3cbc 100644 --- a/doc/html/boost_regex/background/standards.html +++ b/doc/html/boost_regex/background/standards.html @@ -3,8 +3,8 @@ Standards Conformance - - + + diff --git a/doc/html/boost_regex/background/thread_safety.html b/doc/html/boost_regex/background/thread_safety.html index 5b90e616..21fdf428 100644 --- a/doc/html/boost_regex/background/thread_safety.html +++ b/doc/html/boost_regex/background/thread_safety.html @@ -3,8 +3,8 @@ Thread Safety - - + + diff --git a/doc/html/boost_regex/captures.html b/doc/html/boost_regex/captures.html index 717ee405..6ae2b43e 100644 --- a/doc/html/boost_regex/captures.html +++ b/doc/html/boost_regex/captures.html @@ -3,9 +3,9 @@ Understanding Marked Sub-Expressions and Captures - - - + + + diff --git a/doc/html/boost_regex/configuration.html b/doc/html/boost_regex/configuration.html index f4c2093d..0aa2fabb 100644 --- a/doc/html/boost_regex/configuration.html +++ b/doc/html/boost_regex/configuration.html @@ -3,10 +3,10 @@ Configuration - - - - + + + + @@ -26,7 +26,7 @@ -
+
Compiler Setup
Locale and traits class selection
diff --git a/doc/html/boost_regex/configuration/algorithm.html b/doc/html/boost_regex/configuration/algorithm.html index e7859ea4..7b05d130 100644 --- a/doc/html/boost_regex/configuration/algorithm.html +++ b/doc/html/boost_regex/configuration/algorithm.html @@ -3,8 +3,8 @@ Algorithm Selection - - + + diff --git a/doc/html/boost_regex/configuration/compiler.html b/doc/html/boost_regex/configuration/compiler.html index 3dfaa192..7003776c 100644 --- a/doc/html/boost_regex/configuration/compiler.html +++ b/doc/html/boost_regex/configuration/compiler.html @@ -3,8 +3,8 @@ Compiler Setup - - + + diff --git a/doc/html/boost_regex/configuration/linkage.html b/doc/html/boost_regex/configuration/linkage.html index 3109eba8..4942e7c8 100644 --- a/doc/html/boost_regex/configuration/linkage.html +++ b/doc/html/boost_regex/configuration/linkage.html @@ -3,8 +3,8 @@ Linkage Options - - + + diff --git a/doc/html/boost_regex/configuration/locale.html b/doc/html/boost_regex/configuration/locale.html index 896cff8d..e328fbdc 100644 --- a/doc/html/boost_regex/configuration/locale.html +++ b/doc/html/boost_regex/configuration/locale.html @@ -3,8 +3,8 @@ Locale and traits class selection - - + + diff --git a/doc/html/boost_regex/configuration/tuning.html b/doc/html/boost_regex/configuration/tuning.html index 5f8d9674..4ac0304b 100644 --- a/doc/html/boost_regex/configuration/tuning.html +++ b/doc/html/boost_regex/configuration/tuning.html @@ -3,8 +3,8 @@ Algorithm Tuning - - + + diff --git a/doc/html/boost_regex/format.html b/doc/html/boost_regex/format.html index ff2698e6..f9b3c44b 100644 --- a/doc/html/boost_regex/format.html +++ b/doc/html/boost_regex/format.html @@ -3,9 +3,9 @@ Search and Replace Format String Syntax - - - + + + @@ -26,7 +26,7 @@ -
+
Sed Format String Syntax
Perl Format String Syntax
Boost-Extended diff --git a/doc/html/boost_regex/format/boost_format_syntax.html b/doc/html/boost_regex/format/boost_format_syntax.html index 62d8d85d..8393ea35 100644 --- a/doc/html/boost_regex/format/boost_format_syntax.html +++ b/doc/html/boost_regex/format/boost_format_syntax.html @@ -3,8 +3,8 @@ Boost-Extended Format String Syntax - - + + diff --git a/doc/html/boost_regex/format/perl_format.html b/doc/html/boost_regex/format/perl_format.html index 736075c6..560792a8 100644 --- a/doc/html/boost_regex/format/perl_format.html +++ b/doc/html/boost_regex/format/perl_format.html @@ -3,8 +3,8 @@ Perl Format String Syntax - - + + diff --git a/doc/html/boost_regex/format/sed_format.html b/doc/html/boost_regex/format/sed_format.html index bb70ce48..84a22e65 100644 --- a/doc/html/boost_regex/format/sed_format.html +++ b/doc/html/boost_regex/format/sed_format.html @@ -3,8 +3,8 @@ Sed Format String Syntax - - + + diff --git a/doc/html/boost_regex/install.html b/doc/html/boost_regex/install.html index 87ab95da..c0c27485 100644 --- a/doc/html/boost_regex/install.html +++ b/doc/html/boost_regex/install.html @@ -3,9 +3,9 @@ Building and Installing the Library - - - + + + @@ -99,22 +99,143 @@ at the contents of the file boost-root/bin.v2/config.log for the actual error messages obtained when the build carried out the configuration check. You will then need to fix these errors by ensuring your compiler gets - invoked with the correct options, for example: -

-
bjam include=some-include-path --toolset=toolset-name install
-

- will add "some-include-path" to your compilers header include path, - or if ICU has been built with non-standard names for it's binaries, then: -

-
bjam -sICU_LINK="linker-options-for-icu" --toolset=toolset-name install
-

- Will use "linker-options-for-icu" when linking - the library rather than the default ICU binary names. -

-

- You might also need to use the options "cxxflags=-option" and "linkflags=-option" - to set compiler and linker specific options. + invoked with the correct options. The main options that you're likely to pass + to b2 are:

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Option +

+
+

+ Description +

+
+

+ include=/some/path +

+
+

+ Adds "/some/path" to the list of paths seached for include + files, normally equivalent to -I/some/path on most compilers. +

+
+

+ library-path=/some/path +

+
+

+ Adds "/some/path" to the list of paths searched for external + libraries, set this to the location of the ICU binaries if they're + in a non-standard location. +

+
+

+ -sICU_ICUUC_NAME=NAME +

+
+

+ If libicuuc has a + non-standard name then this sets the name of the library linked against, + defaults to either icuuc, + icuucd, sicuuc or sicuucd + depending on build options. +

+
+

+ -sICU_ICUDT_NAME=NAME +

+
+

+ If libicudata has + a non-standard name then this sets the name of the library linked + against, defaults to either icudt, + icudata, sicudt or sicudata + depending on build options and platform. +

+
+

+ -sICU_ICUIN_NAME=NAME +

+
+

+ If libicui18n has + a non-standatd name then this sets the name of the library linked + against, defaults to either icui18n, + icuin, icuind, sicuin or + sicuins` depending on build options and platform. +

+
+

+ cxxstd=XX +

+
+

+ Sets the C++ standard supported: XX should be either 03, 11, 14, + 17 or 2a. +

+
+

+ cxxflags="FLAGS" +

+
+

+ Passes "FLAGS" directly to the compiler, an option of last + resort! +

+
+

+ linflags="FLAGS" +

+
+

+ Passes "FLAGS" directly to the compiler on the link step, + an option of last resort! +

+
@@ -126,16 +247,6 @@ targets to be rebuilt.

[Important]
-

- If ICU is not already in your compiler's path, but instead headers, libraries - and binaries are located at path-to-icu/include, path-to-icu/lib - and path-to-icu/bin respectively then you need to set - the environment variable ICU_PATH - to point to the root directory of your ICU installation: this typically happens - if you're building with MSVC. For example if ICU was installed to c:\download\icu you - might use: -

-
bjam -sICU_PATH=c:\download\icu --toolset=toolset-name install
diff --git a/doc/html/boost_regex/intro.html b/doc/html/boost_regex/intro.html index 6905ce43..b46a7d19 100644 --- a/doc/html/boost_regex/intro.html +++ b/doc/html/boost_regex/intro.html @@ -3,9 +3,9 @@ Introduction and Overview - - - + + + diff --git a/doc/html/boost_regex/partial_matches.html b/doc/html/boost_regex/partial_matches.html index 6c461ce8..1da4ecbd 100644 --- a/doc/html/boost_regex/partial_matches.html +++ b/doc/html/boost_regex/partial_matches.html @@ -3,9 +3,9 @@ Partial Matches - - - + + + diff --git a/doc/html/boost_regex/ref.html b/doc/html/boost_regex/ref.html index 8f7877de..dab15f48 100644 --- a/doc/html/boost_regex/ref.html +++ b/doc/html/boost_regex/ref.html @@ -3,9 +3,9 @@ Reference - - - + + + @@ -26,7 +26,7 @@ -
+
basic_regex
match_results
sub_match
diff --git a/doc/html/boost_regex/ref/bad_expression.html b/doc/html/boost_regex/ref/bad_expression.html index f3b1546e..acf7d919 100644 --- a/doc/html/boost_regex/ref/bad_expression.html +++ b/doc/html/boost_regex/ref/bad_expression.html @@ -3,8 +3,8 @@ bad_expression - - + + diff --git a/doc/html/boost_regex/ref/basic_regex.html b/doc/html/boost_regex/ref/basic_regex.html index fc68a6ab..e9a62f3c 100644 --- a/doc/html/boost_regex/ref/basic_regex.html +++ b/doc/html/boost_regex/ref/basic_regex.html @@ -3,8 +3,8 @@ basic_regex - - + + diff --git a/doc/html/boost_regex/ref/concepts.html b/doc/html/boost_regex/ref/concepts.html index 3c8e9733..19421442 100644 --- a/doc/html/boost_regex/ref/concepts.html +++ b/doc/html/boost_regex/ref/concepts.html @@ -3,8 +3,8 @@ Concepts - - + + @@ -26,7 +26,7 @@ -
+
charT Requirements
Traits Class Requirements
diff --git a/doc/html/boost_regex/ref/concepts/charT_concept.html b/doc/html/boost_regex/ref/concepts/charT_concept.html index f17584c2..adfe5198 100644 --- a/doc/html/boost_regex/ref/concepts/charT_concept.html +++ b/doc/html/boost_regex/ref/concepts/charT_concept.html @@ -3,8 +3,8 @@ charT Requirements - - + + diff --git a/doc/html/boost_regex/ref/concepts/iterator_concepts.html b/doc/html/boost_regex/ref/concepts/iterator_concepts.html index c64888a9..db8ca0f2 100644 --- a/doc/html/boost_regex/ref/concepts/iterator_concepts.html +++ b/doc/html/boost_regex/ref/concepts/iterator_concepts.html @@ -3,8 +3,8 @@ Iterator Requirements - - + + diff --git a/doc/html/boost_regex/ref/concepts/traits_concept.html b/doc/html/boost_regex/ref/concepts/traits_concept.html index d8a55839..ab312979 100644 --- a/doc/html/boost_regex/ref/concepts/traits_concept.html +++ b/doc/html/boost_regex/ref/concepts/traits_concept.html @@ -3,8 +3,8 @@ Traits Class Requirements - - + + diff --git a/doc/html/boost_regex/ref/deprecated.html b/doc/html/boost_regex/ref/deprecated.html index f09dfa91..c2bdb28c 100644 --- a/doc/html/boost_regex/ref/deprecated.html +++ b/doc/html/boost_regex/ref/deprecated.html @@ -3,8 +3,8 @@ Deprecated Interfaces - - + + @@ -26,7 +26,7 @@ -
+
regex_format (Deprecated)
regex_grep (Deprecated)
diff --git a/doc/html/boost_regex/ref/deprecated/old_regex.html b/doc/html/boost_regex/ref/deprecated/old_regex.html index 45fb1e4e..e10200f6 100644 --- a/doc/html/boost_regex/ref/deprecated/old_regex.html +++ b/doc/html/boost_regex/ref/deprecated/old_regex.html @@ -3,8 +3,8 @@ High Level Class RegEx (Deprecated) - - + + diff --git a/doc/html/boost_regex/ref/deprecated/regex_format.html b/doc/html/boost_regex/ref/deprecated/regex_format.html index c34a8531..85d8174d 100644 --- a/doc/html/boost_regex/ref/deprecated/regex_format.html +++ b/doc/html/boost_regex/ref/deprecated/regex_format.html @@ -3,8 +3,8 @@ regex_format (Deprecated) - - + + diff --git a/doc/html/boost_regex/ref/deprecated/regex_grep.html b/doc/html/boost_regex/ref/deprecated/regex_grep.html index dded2993..9b9b929a 100644 --- a/doc/html/boost_regex/ref/deprecated/regex_grep.html +++ b/doc/html/boost_regex/ref/deprecated/regex_grep.html @@ -3,8 +3,8 @@ regex_grep (Deprecated) - - + + diff --git a/doc/html/boost_regex/ref/deprecated/regex_split.html b/doc/html/boost_regex/ref/deprecated/regex_split.html index fc74ce17..88ba58bf 100644 --- a/doc/html/boost_regex/ref/deprecated/regex_split.html +++ b/doc/html/boost_regex/ref/deprecated/regex_split.html @@ -3,8 +3,8 @@ regex_split (deprecated) - - + + diff --git a/doc/html/boost_regex/ref/error_type.html b/doc/html/boost_regex/ref/error_type.html index ff5a080a..f3e527d3 100644 --- a/doc/html/boost_regex/ref/error_type.html +++ b/doc/html/boost_regex/ref/error_type.html @@ -3,8 +3,8 @@ error_type - - + + diff --git a/doc/html/boost_regex/ref/internals.html b/doc/html/boost_regex/ref/internals.html index a7d8cc2d..66ac0882 100644 --- a/doc/html/boost_regex/ref/internals.html +++ b/doc/html/boost_regex/ref/internals.html @@ -3,8 +3,8 @@ Internal Details - - + + @@ -26,7 +26,7 @@ - +
[Important]
diff --git a/doc/html/boost_regex/ref/internals/uni_iter.html b/doc/html/boost_regex/ref/internals/uni_iter.html index fc320015..d3a54bdd 100644 --- a/doc/html/boost_regex/ref/internals/uni_iter.html +++ b/doc/html/boost_regex/ref/internals/uni_iter.html @@ -3,8 +3,8 @@ Unicode Iterators - - + + diff --git a/doc/html/boost_regex/ref/match_flag_type.html b/doc/html/boost_regex/ref/match_flag_type.html index 17c6f8d1..d9a2519d 100644 --- a/doc/html/boost_regex/ref/match_flag_type.html +++ b/doc/html/boost_regex/ref/match_flag_type.html @@ -3,8 +3,8 @@ match_flag_type - - + + diff --git a/doc/html/boost_regex/ref/match_results.html b/doc/html/boost_regex/ref/match_results.html index 61c0566e..8f6ad8d0 100644 --- a/doc/html/boost_regex/ref/match_results.html +++ b/doc/html/boost_regex/ref/match_results.html @@ -3,8 +3,8 @@ match_results - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings.html b/doc/html/boost_regex/ref/non_std_strings.html index 43843eb8..25065098 100644 --- a/doc/html/boost_regex/ref/non_std_strings.html +++ b/doc/html/boost_regex/ref/non_std_strings.html @@ -3,8 +3,8 @@ Interfacing With Non-Standard String Types - - + + @@ -27,7 +27,7 @@ Interfacing With Non-Standard String Types -
+
Working With Unicode and ICU String Types
diff --git a/doc/html/boost_regex/ref/non_std_strings/icu.html b/doc/html/boost_regex/ref/non_std_strings/icu.html index d91c64f7..7cfa1999 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu.html @@ -3,8 +3,8 @@ Working With Unicode and ICU String Types - - + + @@ -27,7 +27,7 @@ Working With Unicode and ICU String Types
-
+
Introduction to using Regex with ICU
Unicode diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/intro.html b/doc/html/boost_regex/ref/non_std_strings/icu/intro.html index a213c920..3b115a88 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/intro.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/intro.html @@ -3,8 +3,8 @@ Introduction to using Regex with ICU - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html index 972cec66..77aafa85 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html @@ -3,8 +3,8 @@ Unicode Regular Expression Algorithms - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html index ba64e3b7..bc77b3d5 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html @@ -3,8 +3,8 @@ Unicode Aware Regex Iterators - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_types.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_types.html index 07e37bf3..18115bb5 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_types.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_types.html @@ -3,8 +3,8 @@ Unicode regular expression types - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings.html index ea87e6ee..f9d2ea2e 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings.html @@ -3,8 +3,8 @@ Using Boost Regex With MFC Strings - - + + @@ -27,7 +27,7 @@ Using Boost Regex With MFC Strings
-
+
Introduction to Boost.Regex and MFC Strings
Regex diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html index 981fbb58..d4a7b611 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html @@ -3,8 +3,8 @@ Overloaded Algorithms For MFC String Types - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_intro.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_intro.html index 5041ba75..e0cbbac1 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_intro.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_intro.html @@ -3,8 +3,8 @@ Introduction to Boost.Regex and MFC Strings - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html index 5b22208c..115289c7 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html @@ -3,8 +3,8 @@ Iterating Over the Matches Within An MFC String - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_create.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_create.html index e9e87298..2be107c1 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_create.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_create.html @@ -3,8 +3,8 @@ Regular Expression Creation From an MFC String - - + + diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_types.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_types.html index 049a154c..682e8245 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_types.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_types.html @@ -3,8 +3,8 @@ Regex Types Used With MFC Strings - - + + diff --git a/doc/html/boost_regex/ref/posix.html b/doc/html/boost_regex/ref/posix.html index 929ac244..2d63eb18 100644 --- a/doc/html/boost_regex/ref/posix.html +++ b/doc/html/boost_regex/ref/posix.html @@ -3,8 +3,8 @@ POSIX Compatible C API's - - + + diff --git a/doc/html/boost_regex/ref/regex_iterator.html b/doc/html/boost_regex/ref/regex_iterator.html index 195600c6..e0fc46b0 100644 --- a/doc/html/boost_regex/ref/regex_iterator.html +++ b/doc/html/boost_regex/ref/regex_iterator.html @@ -3,8 +3,8 @@ regex_iterator - - + + diff --git a/doc/html/boost_regex/ref/regex_match.html b/doc/html/boost_regex/ref/regex_match.html index 9e9a7b82..4527e156 100644 --- a/doc/html/boost_regex/ref/regex_match.html +++ b/doc/html/boost_regex/ref/regex_match.html @@ -3,8 +3,8 @@ regex_match - - + + diff --git a/doc/html/boost_regex/ref/regex_replace.html b/doc/html/boost_regex/ref/regex_replace.html index 61a5237f..b8056d50 100644 --- a/doc/html/boost_regex/ref/regex_replace.html +++ b/doc/html/boost_regex/ref/regex_replace.html @@ -3,8 +3,8 @@ regex_replace - - + + diff --git a/doc/html/boost_regex/ref/regex_search.html b/doc/html/boost_regex/ref/regex_search.html index f10aea59..8fd1eaf4 100644 --- a/doc/html/boost_regex/ref/regex_search.html +++ b/doc/html/boost_regex/ref/regex_search.html @@ -3,8 +3,8 @@ regex_search - - + + diff --git a/doc/html/boost_regex/ref/regex_token_iterator.html b/doc/html/boost_regex/ref/regex_token_iterator.html index d3816978..0b94debe 100644 --- a/doc/html/boost_regex/ref/regex_token_iterator.html +++ b/doc/html/boost_regex/ref/regex_token_iterator.html @@ -3,8 +3,8 @@ regex_token_iterator - - + + diff --git a/doc/html/boost_regex/ref/regex_traits.html b/doc/html/boost_regex/ref/regex_traits.html index aa809bf7..287abb97 100644 --- a/doc/html/boost_regex/ref/regex_traits.html +++ b/doc/html/boost_regex/ref/regex_traits.html @@ -3,8 +3,8 @@ regex_traits - - + + diff --git a/doc/html/boost_regex/ref/sub_match.html b/doc/html/boost_regex/ref/sub_match.html index 049bb0cc..a0a25239 100644 --- a/doc/html/boost_regex/ref/sub_match.html +++ b/doc/html/boost_regex/ref/sub_match.html @@ -3,8 +3,8 @@ sub_match - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type.html b/doc/html/boost_regex/ref/syntax_option_type.html index f7f70655..2f2ea3de 100644 --- a/doc/html/boost_regex/ref/syntax_option_type.html +++ b/doc/html/boost_regex/ref/syntax_option_type.html @@ -3,8 +3,8 @@ syntax_option_type - - + + @@ -26,7 +26,7 @@ -
+
syntax_option_type Synopsis
Overview diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_basic.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_basic.html index 6c898f55..67fff6e2 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_basic.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_basic.html @@ -3,8 +3,8 @@ Options for POSIX Basic Regular Expressions - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_extended.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_extended.html index a98ed8ce..4d4cccc3 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_extended.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_extended.html @@ -3,8 +3,8 @@ Options for POSIX Extended Regular Expressions - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_literal.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_literal.html index 6e952486..cc4fbdcc 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_literal.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_literal.html @@ -3,8 +3,8 @@ Options for Literal Strings - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_overview.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_overview.html index 120bea0d..7a3355ab 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_overview.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_overview.html @@ -3,8 +3,8 @@ Overview of syntax_option_type - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_perl.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_perl.html index 206ed1e4..76a3448a 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_perl.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_perl.html @@ -3,8 +3,8 @@ Options for Perl Regular Expressions - - + + diff --git a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_synopsis.html b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_synopsis.html index 0557b4d9..462b1e7d 100644 --- a/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_synopsis.html +++ b/doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_synopsis.html @@ -3,8 +3,8 @@ syntax_option_type Synopsis - - + + diff --git a/doc/html/boost_regex/syntax.html b/doc/html/boost_regex/syntax.html index 1573d72a..fb27b46f 100644 --- a/doc/html/boost_regex/syntax.html +++ b/doc/html/boost_regex/syntax.html @@ -3,9 +3,9 @@ Regular Expression Syntax - - - + + + @@ -26,7 +26,7 @@ -
-
+
Character Classes that are Always Supported
Character diff --git a/doc/html/boost_regex/syntax/character_classes/optional_char_class_names.html b/doc/html/boost_regex/syntax/character_classes/optional_char_class_names.html index ad35f0fe..887e500b 100644 --- a/doc/html/boost_regex/syntax/character_classes/optional_char_class_names.html +++ b/doc/html/boost_regex/syntax/character_classes/optional_char_class_names.html @@ -3,8 +3,8 @@ Character classes that are supported by Unicode Regular Expressions - - + + diff --git a/doc/html/boost_regex/syntax/character_classes/std_char_classes.html b/doc/html/boost_regex/syntax/character_classes/std_char_classes.html index 42918d24..9686a69b 100644 --- a/doc/html/boost_regex/syntax/character_classes/std_char_classes.html +++ b/doc/html/boost_regex/syntax/character_classes/std_char_classes.html @@ -3,8 +3,8 @@ Character Classes that are Always Supported - - + + diff --git a/doc/html/boost_regex/syntax/collating_names.html b/doc/html/boost_regex/syntax/collating_names.html index 654c21f5..3af40ae3 100644 --- a/doc/html/boost_regex/syntax/collating_names.html +++ b/doc/html/boost_regex/syntax/collating_names.html @@ -3,8 +3,8 @@ Collating Names - - + + @@ -26,7 +26,7 @@ -
+
Digraphs
POSIX Symbolic Names
diff --git a/doc/html/boost_regex/syntax/collating_names/digraphs.html b/doc/html/boost_regex/syntax/collating_names/digraphs.html index a2b502b0..5577a023 100644 --- a/doc/html/boost_regex/syntax/collating_names/digraphs.html +++ b/doc/html/boost_regex/syntax/collating_names/digraphs.html @@ -3,8 +3,8 @@ Digraphs - - + + diff --git a/doc/html/boost_regex/syntax/collating_names/named_unicode.html b/doc/html/boost_regex/syntax/collating_names/named_unicode.html index 4de7775e..67880f37 100644 --- a/doc/html/boost_regex/syntax/collating_names/named_unicode.html +++ b/doc/html/boost_regex/syntax/collating_names/named_unicode.html @@ -3,8 +3,8 @@ Named Unicode Characters - - + + diff --git a/doc/html/boost_regex/syntax/collating_names/posix_symbolic_names.html b/doc/html/boost_regex/syntax/collating_names/posix_symbolic_names.html index 4ab6b0d3..9a8508c5 100644 --- a/doc/html/boost_regex/syntax/collating_names/posix_symbolic_names.html +++ b/doc/html/boost_regex/syntax/collating_names/posix_symbolic_names.html @@ -3,8 +3,8 @@ POSIX Symbolic Names - - + + diff --git a/doc/html/boost_regex/syntax/leftmost_longest_rule.html b/doc/html/boost_regex/syntax/leftmost_longest_rule.html index db03acdf..d4da6d96 100644 --- a/doc/html/boost_regex/syntax/leftmost_longest_rule.html +++ b/doc/html/boost_regex/syntax/leftmost_longest_rule.html @@ -3,8 +3,8 @@ The Leftmost Longest Rule - - + + diff --git a/doc/html/boost_regex/syntax/perl_syntax.html b/doc/html/boost_regex/syntax/perl_syntax.html index fffc1b40..0c389269 100644 --- a/doc/html/boost_regex/syntax/perl_syntax.html +++ b/doc/html/boost_regex/syntax/perl_syntax.html @@ -3,8 +3,8 @@ Perl Regular Expression Syntax - - + + diff --git a/doc/html/boost_regex/unicode.html b/doc/html/boost_regex/unicode.html index e91f1a3c..9e328f87 100644 --- a/doc/html/boost_regex/unicode.html +++ b/doc/html/boost_regex/unicode.html @@ -3,9 +3,9 @@ Unicode and Boost.Regex - - - + + + diff --git a/doc/html/index.html b/doc/html/index.html index cb48f266..032e7026 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,10 +1,10 @@ -Boost.Regex 5.1.3 +Boost.Regex 5.1.4 - - + + @@ -22,7 +22,7 @@

-Boost.Regex 5.1.3

+Boost.Regex 5.1.4

John Maddock

@@ -38,7 +38,7 @@

Table of Contents

-
+
Configuration
Compiler Setup
@@ -215,7 +215,7 @@

- +

Last revised: October 09, 2017 at 17:30:50 GMT

Last revised: October 26, 2019 at 09:28:05 GMT


diff --git a/doc/install.qbk b/doc/install.qbk index fdedaebf..45fea722 100644 --- a/doc/install.qbk +++ b/doc/install.qbk @@ -60,33 +60,23 @@ If you think that it should have been found, then you will need to take a look at the contents of the file ['boost-root/bin.v2/config.log] for the actual error messages obtained when the build carried out the configuration check. You will then need to fix these errors by ensuring your compiler gets invoked with the correct -options, for example: +options. The main options that you're likely to pass to `b2` are: -[pre bjam include=some-include-path --toolset=toolset-name install] - -will add "some-include-path" to your compilers header include path, or if ICU -has been built with non-standard names for it's binaries, then: - -[pre bjam -sICU_LINK="linker-options-for-icu" --toolset=toolset-name install] - -Will use ['"linker-options-for-icu"] when linking the library rather than the default -ICU binary names. - -You might also need to use the options "cxxflags=-option" and "linkflags=-option" to set compiler and linker -specific options. +[table +[[Option][Description]] +[[include=/some/path][Adds "/some/path" to the list of paths seached for include files, normally equivalent to `-I/some/path` on most compilers.]] +[[library-path=/some/path][Adds "/some/path" to the list of paths searched for external libraries, set this to the location of the ICU binaries if they're in a non-standard location.]] +[[-sICU_ICUUC_NAME=NAME][If `libicuuc` has a non-standard name then this sets the name of the library linked against, defaults to either `icuuc`, `icuucd`, `sicuuc` or `sicuucd` depending on build options.]] +[[-sICU_ICUDT_NAME=NAME][If `libicudata` has a non-standard name then this sets the name of the library linked against, defaults to either `icudt`, `icudata`, `sicudt` or `sicudata` depending on build options and platform.]] +[[-sICU_ICUIN_NAME=NAME][If `libicui18n` has a non-standatd name then this sets the name of the library linked against, defaults to either `icui18n`, `icuin`, `icuind`, sicuin` or `sicuins` depending on build options and platform.]] +[[cxxstd=XX][Sets the C++ standard supported: XX should be either 03, 11, 14, 17 or 2a.]] +[[cxxflags="FLAGS"][Passes "FLAGS" directly to the compiler, an option of last resort!]] +[[linflags="FLAGS"][Passes "FLAGS" directly to the compiler on the link step, an option of last resort!]] +] [important Configuration results are cached - if you try rebuilding with different compiler options then add an "-a" to the bjam command line to force all targets to be rebuilt.] -If ICU is not already in your compiler's path, but instead headers, libraries and binaries -are located at ['path-to-icu/include], ['path-to-icu/lib] and ['path-to-icu/bin] respectively -then you need to set the environment variable `ICU_PATH` to point to the root directory of your -ICU installation: this typically happens if you're building with MSVC. -For example if ICU was installed to `c:\download\icu` you -might use: - -[pre bjam -sICU_PATH=c:\download\icu --toolset=toolset-name install] - [important ICU is a C++ library just like Boost is, as such your copy of ICU must have been built with the same C++ compiler (and compiler version) that you are using to build Boost. Boost.Regex will not work correctly unless diff --git a/doc/regex.qbk b/doc/regex.qbk index bac8936f..c13e5587 100644 --- a/doc/regex.qbk +++ b/doc/regex.qbk @@ -8,7 +8,7 @@ [@http://www.boost.org/LICENSE_1_0.txt]) ] [authors [Maddock, John]] - [version 5.1.3] + [version 5.1.4] [/last-revision $Date$] ] diff --git a/example/snippets/CMakeLists.txt b/example/snippets/CMakeLists.txt new file mode 100644 index 00000000..f672785b --- /dev/null +++ b/example/snippets/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright 2019 Mike Dev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt +# +# NOTE: CMake support for Boost.Regex is currently experimental at best +# and we are currently only building a few examples + +set(examples + partial_regex_grep + partial_regex_iterate + partial_regex_match + regex_grep_example_1 + regex_grep_example_2 + regex_grep_example_3 + regex_grep_example_4 + regex_iterator_example + regex_match_example + regex_merge_example + regex_replace_example + regex_search_example + regex_split_example_1 + regex_split_example_2 + regex_token_iterator_eg_1 + regex_token_iterator_eg_2 +) + +foreach( example IN LISTS examples ) + add_executable( boost_regex_ex_${example} ${example}.cpp ) + target_link_libraries( boost_regex_ex_${example} Boost::regex ) +endforeach() diff --git a/example/snippets/regex_grep_example_4.cpp b/example/snippets/regex_grep_example_4.cpp index 533d896e..e50383b3 100644 --- a/example/snippets/regex_grep_example_4.cpp +++ b/example/snippets/regex_grep_example_4.cpp @@ -17,7 +17,7 @@ * using a C++ Builder closure as a callback. */ -#ifdef __BORLANDC__ +#if defined(__BORLANDC__) && !defined(__clang__) #include #include @@ -140,7 +140,7 @@ int main(int argc, const char** argv) return 0; } -#else // __BORLANDC__ +#else // __BORLANDC__ && !defined(__clang__) int main() { diff --git a/example/snippets/regex_match_example.cpp b/example/snippets/regex_match_example.cpp index dd10de4d..16ba79b9 100644 --- a/example/snippets/regex_match_example.cpp +++ b/example/snippets/regex_match_example.cpp @@ -49,7 +49,7 @@ int process_ftp(const char* response, std::string* msg) return -1; } -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/snippets/regex_split_example_1.cpp b/example/snippets/regex_split_example_1.cpp index df2ef96b..76a3c950 100644 --- a/example/snippets/regex_split_example_1.cpp +++ b/example/snippets/regex_split_example_1.cpp @@ -30,7 +30,7 @@ unsigned tokenise(std::list& l, std::string& s) using namespace std; -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/snippets/regex_token_iterator_eg_1.cpp b/example/snippets/regex_token_iterator_eg_1.cpp index f1ecb44d..74fcbf1a 100644 --- a/example/snippets/regex_token_iterator_eg_1.cpp +++ b/example/snippets/regex_token_iterator_eg_1.cpp @@ -23,7 +23,7 @@ using namespace std; -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/timer/regex_timer.cpp b/example/timer/regex_timer.cpp index 48f41a9b..d121b70f 100644 --- a/example/timer/regex_timer.cpp +++ b/example/timer/regex_timer.cpp @@ -89,7 +89,7 @@ public: }; namespace boost{ -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) || defined(__SGI_STL_PORT) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) || defined(__SGI_STL_PORT) // // problem with std::getline under MSVC6sp3 // and C++ Builder 5.5, is this really that hard? @@ -367,16 +367,9 @@ int main(int argc, char**argv) } #if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(UNDER_CE) +#if !defined(BOOST_EMBTC) #pragma comment(lib, "user32.lib") +#else +#pragma comment(lib, "user32.a") +#endif #endif - - - - - - - - - - - diff --git a/include/boost/regex/concepts.hpp b/include/boost/regex/concepts.hpp index 8cd5d995..276e63f7 100644 --- a/include/boost/regex/concepts.hpp +++ b/include/boost/regex/concepts.hpp @@ -437,7 +437,8 @@ struct BaseRegexConcept ignore_unused_variable_warning(bi); sub_diff_type diff = m_sub.length(); ignore_unused_variable_warning(diff); - // match_results tests: + // match_results tests - some typedefs are not used, however these + // guarante that they exist (some compilers may warn on non-usage) typedef typename match_results_type::value_type mr_value_type; typedef typename match_results_type::const_reference mr_const_reference; typedef typename match_results_type::reference mr_reference; @@ -483,7 +484,7 @@ struct BaseRegexConcept mrci = m_cresults.end(); ignore_unused_variable_warning(mrci); - mr_allocator_type at2 = m_cresults.get_allocator(); + (void) m_cresults.get_allocator(); m_results.swap(m_results); global_regex_namespace::swap(m_results, m_results); diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index eb998110..9b75d507 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -22,7 +22,7 @@ * Borland C++ Fix/error check * this has to go *before* we include any std lib headers: */ -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) && !defined(__clang__) # include #endif #include @@ -113,6 +113,17 @@ #if defined(__MINGW32__) # define BOOST_REGEX_NO_EXTERNAL_TEMPLATES #endif +/* + * Clang fails to export template instances with -fvisibility=hidden, see + * https://github.com/boostorg/regex/issues/49 + */ +#ifdef __clang__ +# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES +#endif +#ifdef __CYGWIN__ +/* We get multiply defined symbols without this: */ +# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES +#endif /* * If there isn't good enough wide character support then there will @@ -201,7 +212,10 @@ # define BOOST_REGEX_HAS_OTHER_WCHAR_T # ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable : 4251 4231) +# pragma warning(disable : 4251) +#if BOOST_MSVC < 1700 +# pragma warning(disable : 4231) +#endif # if BOOST_MSVC < 1600 # pragma warning(disable : 4660) # endif @@ -265,9 +279,14 @@ #endif #if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32) +#if defined(__clang__) +# define BOOST_REGEX_CALL __cdecl +# define BOOST_REGEX_CCALL __cdecl +#else # define BOOST_REGEX_CALL __fastcall # define BOOST_REGEX_CCALL __stdcall #endif +#endif #ifndef BOOST_REGEX_CALL # define BOOST_REGEX_CALL @@ -364,7 +383,7 @@ if(0 == (x))\ #if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3) # if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \ - && !defined(__GNUC__) \ + && !(defined(__GNUC__) || defined(__BORLANDC__) && defined(__clang__)) \ && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \ && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003)) # define BOOST_REGEX_HAS_MS_STACK_GUARD diff --git a/include/boost/regex/config/borland.hpp b/include/boost/regex/config/borland.hpp index 51c2126b..981113e5 100644 --- a/include/boost/regex/config/borland.hpp +++ b/include/boost/regex/config/borland.hpp @@ -17,7 +17,7 @@ */ -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) && !defined(__clang__) # if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551) // problems with std::basic_string and dll RTL: # if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE) diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index 004b67f3..7ca409d8 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -43,13 +43,16 @@ namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable : 4275) +#if BOOST_MSVC >= 1800 +#pragma warning(disable : 26812) +#endif #endif class BOOST_REGEX_DECL regex_error : public std::runtime_error { public: explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0); explicit regex_error(regex_constants::error_type err); - ~regex_error() throw(); + ~regex_error() BOOST_NOEXCEPT_OR_NOTHROW; regex_constants::error_type code()const { return m_error_code; } std::ptrdiff_t position()const diff --git a/include/boost/regex/pending/object_cache.hpp b/include/boost/regex/pending/object_cache.hpp index c47862f0..ea51ba3a 100644 --- a/include/boost/regex/pending/object_cache.hpp +++ b/include/boost/regex/pending/object_cache.hpp @@ -57,6 +57,10 @@ private: friend struct data; }; +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4702) +#endif template boost::shared_ptr object_cache::get(const Key& k, size_type l_max_cache_size) { @@ -80,6 +84,9 @@ boost::shared_ptr object_cache::get(const Key& k, siz return do_get(k, l_max_cache_size); #endif } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif template boost::shared_ptr object_cache::do_get(const Key& k, size_type l_max_cache_size) diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index ac91af29..c56dd8ef 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -20,7 +20,7 @@ #define BOOST_REGEX_V4_BASIC_REGEX_HPP #include -#include +#include #ifdef BOOST_MSVC #pragma warning(push) @@ -36,10 +36,16 @@ namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable : 4251 4231 4800) +#pragma warning(disable : 4251) +#if BOOST_MSVC < 1700 +# pragma warning(disable : 4231) +#endif #if BOOST_MSVC < 1600 #pragma warning(disable : 4660) #endif +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace BOOST_REGEX_DETAIL_NS{ @@ -64,13 +70,14 @@ void bubble_down_one(I first, I last) } } +static const int hash_value_mask = 1 << (std::numeric_limits::digits - 1); + template inline int hash_value_from_capture_name(Iterator i, Iterator j) { std::size_t r = boost::hash_range(i, j); - r %= ((std::numeric_limits::max)() - 10001); - r += 10000; - return static_cast(r); + r %= ((std::numeric_limits::max)()); + return static_cast(r) | hash_value_mask; } class named_subexpressions @@ -164,9 +171,19 @@ struct regex_data : public named_subexpressions regex_data(const ::boost::shared_ptr< ::boost::regex_traits_wrapper >& t) - : m_ptraits(t), m_expression(0), m_expression_len(0), m_disable_match_any(false) {} + : m_ptraits(t), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), + m_mark_count(0), m_first_state(0), m_restart_type(0), +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) + m_startmap{ 0 }, +#endif + m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} regex_data() - : m_ptraits(new ::boost::regex_traits_wrapper()), m_expression(0), m_expression_len(0), m_disable_match_any(false) {} + : m_ptraits(new ::boost::regex_traits_wrapper()), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), + m_mark_count(0), m_first_state(0), m_restart_type(0), +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) + m_startmap{ 0 }, +#endif + m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} ::boost::shared_ptr< ::boost::regex_traits_wrapper diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 623e06f1..f4b1660a 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -20,6 +20,8 @@ #ifndef BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP #define BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP +#include + #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) @@ -33,7 +35,9 @@ #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable: 4800) +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace boost{ @@ -237,7 +241,7 @@ protected: bool m_icase; // true for case insensitive matches unsigned m_repeater_id; // the state_id of the next repeater bool m_has_backrefs; // true if there are actually any backrefs - unsigned m_backrefs; // bitmask of permitted backrefs + indexed_bit_flag m_backrefs; // bitmask of permitted backrefs boost::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for; bool m_has_recursions; // set when we have recursive expresisons to fixup std::vector m_recursion_checks; // notes which recursions we've followed while analysing this expression @@ -265,7 +269,8 @@ private: template basic_regex_creator::basic_regex_creator(regex_data* data) - : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false) + : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_icase(false), m_repeater_id(0), + m_has_backrefs(false), m_bad_repeats(0), m_has_recursions(false), m_word_mask(0), m_mask_space(0), m_lower_mask(0), m_upper_mask(0), m_alpha_mask(0) { m_pdata->m_data.clear(); m_pdata->m_status = ::boost::regex_constants::error_ok; @@ -589,7 +594,7 @@ re_syntax_base* basic_regex_creator::append_set( return 0; } // everything in range matches: - std::memset(result->_map + static_cast(c1), true, 1 + static_cast(c2) - static_cast(c1)); + std::memset(result->_map + static_cast(c1), true, static_cast(1u) + static_cast(static_cast(c2) - static_cast(c1))); } } // @@ -761,7 +766,7 @@ void basic_regex_creator::fixup_recursions(re_syntax_base* state) if(idx < 0) { idx = -idx-1; - if(idx >= 10000) + if(idx >= hash_value_mask) { idx = m_pdata->get_id(idx); if(idx <= 0) @@ -793,7 +798,7 @@ void basic_regex_creator::fixup_recursions(re_syntax_base* state) bool ok = false; re_syntax_base* p = base; std::ptrdiff_t idx = static_cast(state)->alt.i; - if(idx > 10000) + if(idx >= hash_value_mask) { // // There may be more than one capture group with this hash, just do what Perl @@ -1065,9 +1070,21 @@ int basic_regex_creator::calculate_backstep(re_syntax_base* state return -1; } +struct recursion_saver +{ + std::vector saved_state; + std::vector* state; + recursion_saver(std::vector* p) : saved_state(*p), state(p) {} + ~recursion_saver() + { + state->swap(saved_state); + } +}; + template void basic_regex_creator::create_startmap(re_syntax_base* state, unsigned char* l_map, unsigned int* pnull, unsigned char mask) { + recursion_saver saved_recursions(&m_recursion_checks); int not_last_jump = 1; re_syntax_base* recursion_start = 0; int recursion_sub = 0; @@ -1510,6 +1527,10 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = state->next.p; continue; } +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:6011) +#endif if((static_cast(state)->index == -1) || (static_cast(state)->index == -2)) { @@ -1517,6 +1538,9 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = static_cast(state->next.p)->alt.p->next.p; continue; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif if(static_cast(state)->index == -3) { // Have to skip the leading jump state: diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index dc528a39..8bdb079f 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -22,6 +22,9 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) +#if BOOST_MSVC >= 1800 +#pragma warning(disable: 26812) +#endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -35,7 +38,10 @@ namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4244 4800) +#pragma warning(disable:4244) +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif inline boost::intmax_t umax(mpl::false_ const&) @@ -121,7 +127,8 @@ private: template basic_regex_parser::basic_regex_parser(regex_data* data) - : basic_regex_creator(data), m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0) + : basic_regex_creator(data), m_parser_proc(), m_base(0), m_end(0), m_position(0), + m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0) { } @@ -190,7 +197,7 @@ void basic_regex_parser::parse(const charT* p1, const charT* p2, if(this->m_pdata->m_status) return; // fill in our sub-expression count: - this->m_pdata->m_mark_count = 1 + m_mark_count; + this->m_pdata->m_mark_count = 1u + (std::size_t)m_mark_count; this->finalize(p1, p2); } @@ -318,6 +325,12 @@ bool basic_regex_parser::parse_basic() return true; } +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26812) +#endif +#endif template bool basic_regex_parser::parse_extended() { @@ -406,6 +419,9 @@ bool basic_regex_parser::parse_extended() return result; } #ifdef BOOST_MSVC +# pragma warning(pop) +#endif +#ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -542,8 +558,8 @@ bool basic_regex_parser::parse_open_paren() // // allow backrefs to this mark: // - if((markid > 0) && (markid < sizeof(unsigned) * CHAR_BIT)) - this->m_backrefs |= 1u << (markid - 1); + if(markid > 0) + this->m_backrefs.set(markid); return true; } @@ -856,7 +872,7 @@ escape_type_class_jump: { bool have_brace = false; bool negative = false; - static const char* incomplete_message = "Incomplete \\g escape found."; + static const char incomplete_message[] = "Incomplete \\g escape found."; if(++m_position == m_end) { fail(regex_constants::error_escape, m_position - m_base, incomplete_message); @@ -908,8 +924,8 @@ escape_type_class_jump: pc = m_position; } if(negative) - i = 1 + m_mark_count - i; - if(((i > 0) && (i < std::numeric_limits::digits) && (i - 1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_pdata->get_id(i)-1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1))))) + i = 1 + (static_cast(m_mark_count) - i); + if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test(i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id(i))))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); @@ -1130,7 +1146,7 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ template bool basic_regex_parser::parse_repeat_range(bool isbasic) { - static const char* incomplete_message = "Missing } in quantified repetition."; + static const char incomplete_message[] = "Missing } in quantified repetition."; // // parse a repeat-range: // @@ -1336,7 +1352,7 @@ bool basic_regex_parser::parse_alt() template bool basic_regex_parser::parse_set() { - static const char* incomplete_message = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; + static const char incomplete_message[] = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; ++m_position; if(m_position == m_end) { @@ -1428,7 +1444,7 @@ bool basic_regex_parser::parse_set() template bool basic_regex_parser::parse_inner_set(basic_char_set& char_set) { - static const char* incomplete_message = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; + static const char incomplete_message[] = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; // // we have either a character class [:name:] // a collating element [.name.] @@ -1941,7 +1957,7 @@ bool basic_regex_parser::parse_backref() charT c = unescape_character(); this->append_literal(c); } - else if((i > 0) && (this->m_backrefs & (1u << (i-1)))) + else if((i > 0) && (this->m_backrefs.test(i))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); @@ -2129,7 +2145,7 @@ insert_recursion: // Oops not a relative recursion at all, but a (?-imsx) group: goto option_group_jump; } - v = m_mark_count + 1 - v; + v = static_cast(m_mark_count) + 1 - v; if(v <= 0) { // Rewind to start of (? sequence: @@ -2707,7 +2723,7 @@ option_group_jump: { #ifndef BOOST_NO_STD_DISTANCE if(this->flags() & regbase::save_subexpression_location) - this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position) - 1; + this->m_pdata->m_subs.at((std::size_t)markid - 1).second = std::distance(m_base, m_position) - 1; #else if(this->flags() & regbase::save_subexpression_location) this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base) - 1; @@ -2715,8 +2731,7 @@ option_group_jump: // // allow backrefs to this mark: // - if(markid < (int)(sizeof(unsigned) * CHAR_BIT)) - this->m_backrefs |= 1u << (markid - 1); + this->m_backrefs.set(markid); } return true; } @@ -2744,6 +2759,12 @@ bool basic_regex_parser::match_verb(const char* verb) return true; } +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26812) +#endif +#endif template bool basic_regex_parser::parse_perl_verb() { @@ -2912,6 +2933,9 @@ bool basic_regex_parser::parse_perl_verb() fail(regex_constants::error_perl_extension, m_position - m_base); return false; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template bool basic_regex_parser::add_emacs_code(bool negate) diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index b7b32d8a..1370b0d5 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -174,7 +174,7 @@ template struct cpp_regex_traits_base { cpp_regex_traits_base(const std::locale& l) - { imbue(l); } + { (void)imbue(l); } std::locale imbue(const std::locale& l); std::locale m_locale; @@ -616,7 +616,7 @@ typename cpp_regex_traits_implementation::string_type // std::collate::transform returns a different string! // So as a workaround, we'll truncate the string at the first NULL // which _seems_ to work.... -#if BOOST_WORKAROUND(__BORLANDC__, < 0x580) +#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x580) result.erase(result.find(charT(0))); #else // @@ -669,7 +669,7 @@ typename cpp_regex_traits_implementation::string_type return pos->second; } #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -679,7 +679,7 @@ typename cpp_regex_traits_implementation::string_type #endif name = lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else diff --git a/include/boost/regex/v4/cregex.hpp b/include/boost/regex/v4/cregex.hpp index 67abfbee..daac7e63 100644 --- a/include/boost/regex/v4/cregex.hpp +++ b/include/boost/regex/v4/cregex.hpp @@ -231,7 +231,7 @@ struct pred4; } /* namespace BOOST_REGEX_DETAIL_NS */ -#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32) +#if (defined(BOOST_MSVC) || defined(BOOST_BORLANDC)) && !defined(BOOST_DISABLE_WIN32) typedef bool (__cdecl *GrepCallback)(const RegEx& expression); typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression); typedef bool (__cdecl *FindFilesCallback)(const char* file); diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp index 7c865c63..79260f26 100644 --- a/include/boost/regex/v4/fileiter.hpp +++ b/include/boost/regex/v4/fileiter.hpp @@ -270,6 +270,8 @@ public: return *this; } + #if !defined(BOOST_EMBTC) + friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j) { return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset); @@ -308,8 +310,64 @@ public: { return i.position() - j.position(); } + + #else + + friend bool operator==(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator<(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator>(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j); + friend mapfile_iterator operator + (const mapfile_iterator& i, long off); + friend mapfile_iterator operator + (long off, const mapfile_iterator& i); + friend mapfile_iterator operator - (const mapfile_iterator& i, long off); + friend long operator - (const mapfile_iterator& i, const mapfile_iterator& j); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j) + { + return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset); + } + + inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return !(i == j); + } + + inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() < j.position(); + } + inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() > j.position(); + } + inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() <= j.position(); + } + inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() >= j.position(); + } + mapfile_iterator operator + (long off, const mapfile_iterator& i) + { + mapfile_iterator tmp(i); + return tmp += off; + } + inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() - j.position(); + } + +#endif + #endif // _fi_sep determines the directory separator, either '\\' or '/' @@ -351,6 +409,8 @@ public: file_iterator operator++(int); const char* operator*() { return path(); } + #if !defined(BOOST_EMBTC) + friend inline bool operator == (const file_iterator& f1, const file_iterator& f2) { return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); @@ -361,8 +421,29 @@ public: return !(f1 == f2); } + #else + + friend bool operator == (const file_iterator& f1, const file_iterator& f2); + friend bool operator != (const file_iterator& f1, const file_iterator& f2); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator == (const file_iterator& f1, const file_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + inline bool operator != (const file_iterator& f1, const file_iterator& f2) + { + return !(f1 == f2); + } + +#endif + // dwa 9/13/00 - suppress unused parameter warning inline bool operator < (const file_iterator&, const file_iterator&) { @@ -401,6 +482,8 @@ public: static const char* separator() { return _fi_sep; } + #if !defined(BOOST_EMBTC) + friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2) { return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); @@ -412,8 +495,30 @@ public: return !(f1 == f2); } + #else + + friend bool operator == (const directory_iterator& f1, const directory_iterator& f2); + friend bool operator != (const directory_iterator& f1, const directory_iterator& f2); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator == (const directory_iterator& f1, const directory_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + + inline bool operator != (const directory_iterator& f1, const directory_iterator& f2) + { + return !(f1 == f2); + } + +#endif + inline bool operator < (const directory_iterator&, const directory_iterator&) { return false; diff --git a/include/boost/regex/v4/indexed_bit_flag.hpp b/include/boost/regex/v4/indexed_bit_flag.hpp new file mode 100644 index 00000000..c9d32c59 --- /dev/null +++ b/include/boost/regex/v4/indexed_bit_flag.hpp @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2020 + * John Maddock + * + * Use, modification and distribution are subject to 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) + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE basic_regex_parser.cpp + * VERSION see + * DESCRIPTION: Declares template class basic_regex_parser. + */ + +#include +#include + +#ifndef BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP +#define BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP + +namespace boost{ +namespace BOOST_REGEX_DETAIL_NS{ + +class indexed_bit_flag +{ + boost::uint64_t low_mask; + std::set mask_set; +public: + indexed_bit_flag() : low_mask(0) {} + void set(std::size_t i) + { + if (i < std::numeric_limits::digits - 1) + low_mask |= static_cast(1u) << i; + else + mask_set.insert(i); + } + bool test(std::size_t i) + { + if (i < std::numeric_limits::digits - 1) + return low_mask & static_cast(1u) << i ? true : false; + else + return mask_set.find(i) != mask_set.end(); + } +}; + +} // namespace BOOST_REGEX_DETAIL_NS +} // namespace boost + + +#endif diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index 05ac71a6..7c18b6e8 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -41,7 +41,7 @@ namespace boost{ // what follows is compiler specific: // -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600) +#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x600) #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -84,7 +84,10 @@ template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE) -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wkeyword-macro" +#if defined(__clang__) +# pragma clang diagnostic push +# if defined(__APPLE_CC__) +# if (__clang_major__ > 6) +# pragma clang diagnostic ignored "-Wkeyword-macro" +# endif +# else +# if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ > 5)) +# pragma clang diagnostic ignored "-Wkeyword-macro" +# endif +# endif #endif # ifndef BOOST_REGEX_INSTANTIATE diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index 1938b27a..1f7ed255 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -22,13 +22,19 @@ #ifdef __cplusplus # include #endif -#include #ifdef __cplusplus namespace boost{ namespace regex_constants{ #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable : 26812) +#endif +#endif + typedef enum _match_flags { match_default = 0, @@ -83,7 +89,7 @@ typedef enum _match_flags } match_flags; -#if defined(__BORLANDC__) || BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +#if defined(BOOST_BORLANDC) || (defined(_MSC_VER) && (_MSC_VER <= 1310)) typedef unsigned long match_flag_type; #else typedef match_flags match_flag_type; @@ -144,6 +150,11 @@ using regex_constants::format_no_copy; using regex_constants::format_first_only; /*using regex_constants::format_is_if;*/ +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + + } /* namespace boost */ #endif /* __cplusplus */ #endif /* include guard */ diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp index 6af46952..7e509801 100644 --- a/include/boost/regex/v4/match_results.hpp +++ b/include/boost/regex/v4/match_results.hpp @@ -33,7 +33,10 @@ namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable : 4251 4231) +#pragma warning(disable : 4251) +#if BOOST_MSVC < 1700 +# pragma warning(disable : 4231) +#endif # if BOOST_MSVC < 1600 # pragma warning(disable : 4660) # endif @@ -92,7 +95,7 @@ public: // See https://svn.boost.org/trac/boost/ticket/3632. // match_results(const match_results& m) - : m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) + : m_subs(m.m_subs), m_base(), m_null(), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) { if(!m_is_singular) { diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index a696e5d9..05886b08 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -27,7 +27,16 @@ #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable: 4800) +#pragma warning(disable : 4251) +#if BOOST_MSVC < 1700 +# pragma warning(disable : 4231) +#endif +# if BOOST_MSVC < 1600 +# pragma warning(disable : 4660) +# endif +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace boost{ @@ -339,6 +348,12 @@ enum saved_state_type saved_state_count = 14 }; +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26495) +#endif +#endif template struct recursion_info { @@ -350,13 +365,8 @@ struct recursion_info repeater_count* repeater_stack; iterator location_of_start; }; - #ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable : 4251 4231) -# if BOOST_MSVC < 1600 -# pragma warning(disable : 4660) -# endif +# pragma warning(pop) #endif template @@ -573,6 +583,12 @@ private: unsigned m_recursions; #endif +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26495) +#endif +#endif // these operations aren't allowed, so are declared private, // bodies are provided to keep explicit-instantiation requests happy: perl_matcher& operator=(const perl_matcher&) @@ -581,14 +597,17 @@ private: } perl_matcher(const perl_matcher& that) : m_result(that.m_result), re(that.re), traits_inst(that.traits_inst), rep_obj(0) {} +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif }; -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - } // namespace BOOST_REGEX_DETAIL_NS +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) @@ -602,10 +621,6 @@ private: } // namespace boost -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - // // include the implementation of perl_matcher: // diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index a0973da9..dd767968 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -23,6 +23,9 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) +#if BOOST_MSVC >= 1800 +#pragma warning(disable: 26812) +#endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -31,18 +34,24 @@ #pragma warning(pop) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC # pragma option push -w-8008 -w-8066 #endif #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable: 4800) +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -template +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif + template void perl_matcher::construct_init(const basic_regex& e, match_flag_type f) { typedef typename regex_iterator_traits::iterator_category category; @@ -92,6 +101,9 @@ void perl_matcher::construct_init(const basic_r if(e.get_data().m_disable_match_any) m_match_flags &= regex_constants::match_not_any; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template void perl_matcher::estimate_max_state_count(std::random_access_iterator_tag*) @@ -476,12 +488,14 @@ bool perl_matcher::match_word_boundary() } else { - b = (m_match_flags & match_not_eow) ? true : false; + if (m_match_flags & match_not_eow) + return false; + b = false; } if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) { if(m_match_flags & match_not_bow) - b ^= true; + return false; else b ^= false; } @@ -605,7 +619,7 @@ bool perl_matcher::match_backref() // or PCRE. // int index = static_cast(pstate)->index; - if(index >= 10000) + if(index >= hash_value_mask) { named_subexpressions::range_type r = re.get_data().equal_range(index); BOOST_ASSERT(r.first != r.second); @@ -754,7 +768,7 @@ inline bool perl_matcher::match_assert_backref( { // Have we matched subexpression "index"? // Check if index is a hash value: - if(index >= 10000) + if(index >= hash_value_mask) { named_subexpressions::range_type r = re.get_data().equal_range(index); while(r.first != r.second) @@ -778,7 +792,7 @@ inline bool perl_matcher::match_assert_backref( // Have we recursed into subexpression "index"? // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. int idx = -(index+1); - if(idx >= 10000) + if(idx >= hash_value_mask) { named_subexpressions::range_type r = re.get_data().equal_range(idx); int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx; @@ -998,7 +1012,7 @@ bool perl_matcher::find_restart_lit() # pragma warning(pop) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC # pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 1cda64d9..4ce93790 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -34,7 +34,10 @@ #endif #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable: 4800 4706) +# pragma warning(disable: 4706) +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace boost{ @@ -64,7 +67,7 @@ struct saved_matched_paren : public saved_state { int index; sub_match sub; - saved_matched_paren(int i, const sub_match& s) : saved_state(1), index(i), sub(s){}; + saved_matched_paren(int i, const sub_match& s) : saved_state(1), index(i), sub(s){} }; template @@ -72,7 +75,7 @@ struct saved_position : public saved_state { const re_syntax_base* pstate; BidiIterator position; - saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){}; + saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){} }; template @@ -80,7 +83,7 @@ struct saved_assertion : public saved_position { bool positive; saved_assertion(bool p, const re_syntax_base* ps, BidiIterator pos) - : saved_position(ps, pos, saved_type_assertion), positive(p){}; + : saved_position(ps, pos, saved_type_assertion), positive(p){} }; template @@ -597,7 +600,7 @@ bool perl_matcher::match_rep() #pragma warning(push) #pragma warning(disable:4127 4244) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -688,7 +691,7 @@ bool perl_matcher::match_rep() } } return false; -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -787,7 +790,7 @@ bool perl_matcher::match_char_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -847,7 +850,7 @@ bool perl_matcher::match_char_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -862,7 +865,7 @@ bool perl_matcher::match_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -921,7 +924,7 @@ bool perl_matcher::match_set_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -936,7 +939,7 @@ bool perl_matcher::match_long_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif typedef typename traits::char_class_type m_type; @@ -996,7 +999,7 @@ bool perl_matcher::match_long_set_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index 6c33ba47..c33475f0 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -548,7 +548,7 @@ bool perl_matcher::match_char_repeat() #pragma warning(disable:4127) #pragma warning(disable:4267) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -637,7 +637,7 @@ bool perl_matcher::match_char_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -652,7 +652,7 @@ bool perl_matcher::match_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -732,7 +732,7 @@ bool perl_matcher::match_set_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -747,7 +747,7 @@ bool perl_matcher::match_long_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif typedef typename traits::char_class_type char_class_type; @@ -828,7 +828,7 @@ bool perl_matcher::match_long_set_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index b65ffcc9..33c4a5cb 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -90,6 +90,10 @@ struct trivial_format_traits } }; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif template class basic_regex_formatter { @@ -203,6 +207,9 @@ private: basic_regex_formatter(const basic_regex_formatter&); basic_regex_formatter& operator=(const basic_regex_formatter&); }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template OutputIterator basic_regex_formatter::format(ForwardIter p1, ForwardIter p2, match_flag_type f) diff --git a/include/boost/regex/v4/regex_iterator.hpp b/include/boost/regex/v4/regex_iterator.hpp index 380a9a71..bbdeed58 100644 --- a/include/boost/regex/v4/regex_iterator.hpp +++ b/include/boost/regex/v4/regex_iterator.hpp @@ -50,6 +50,8 @@ class regex_iterator_implementation public: regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f) : base(), end(last), re(*p), flags(f){} + regex_iterator_implementation(const regex_iterator_implementation& other) + :what(other.what), base(other.base), end(other.end), re(other.re), flags(other.flags){} bool init(BidirectionalIterator first) { base = first; diff --git a/include/boost/regex/v4/regex_raw_buffer.hpp b/include/boost/regex/v4/regex_raw_buffer.hpp index fcdb856a..f1f4f50a 100644 --- a/include/boost/regex/v4/regex_raw_buffer.hpp +++ b/include/boost/regex/v4/regex_raw_buffer.hpp @@ -138,12 +138,12 @@ public: size_type BOOST_REGEX_CALL size() { - return end - start; + return size_type(end - start); } size_type BOOST_REGEX_CALL capacity() { - return last - start; + return size_type(last - start); } void* BOOST_REGEX_CALL data()const @@ -153,7 +153,7 @@ public: size_type BOOST_REGEX_CALL index(void* ptr) { - return static_cast(ptr) - static_cast(data()); + return size_type(static_cast(ptr) - static_cast(data())); } void BOOST_REGEX_CALL clear() diff --git a/include/boost/regex/v4/regex_split.hpp b/include/boost/regex/v4/regex_split.hpp index 65b2c64a..afa56598 100644 --- a/include/boost/regex/v4/regex_split.hpp +++ b/include/boost/regex/v4/regex_split.hpp @@ -36,7 +36,9 @@ namespace boost{ #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable: 4800) +#if BOOST_MSVC < 1910 +#pragma warning(disable:4800) +#endif #endif namespace BOOST_REGEX_DETAIL_NS{ diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index fde51d74..ab15a257 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -21,7 +21,7 @@ #include #include -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // // Borland C++ Builder 6, and Visual C++ 6, @@ -67,16 +67,16 @@ class regex_token_iterator_implementation public: regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, int sub, match_flag_type f) - : end(last), re(*p), flags(f){ subs.push_back(sub); } + : end(last), re(*p), flags(f), N(0){ subs.push_back(sub); } regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector& v, match_flag_type f) - : end(last), re(*p), flags(f), subs(v){} + : end(last), re(*p), flags(f), N(0), subs(v){} #if !BOOST_WORKAROUND(__HP_aCC, < 60700) -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \ || BOOST_WORKAROUND(__HP_aCC, < 60700) template regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f) - : end(last), re(*p), flags(f) + : end(last), re(*p), flags(f), N(0) { // assert that T really is an array: BOOST_STATIC_ASSERT(::boost::is_array::value); @@ -89,7 +89,7 @@ public: #else template regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f) - : end(last), re(*p), flags(f) + : end(last), re(*p), flags(f), N(0) { for(std::size_t i = 0; i < CN; ++i) { @@ -196,7 +196,7 @@ public: pdata.reset(); } #if !BOOST_WORKAROUND(__HP_aCC, < 60700) -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \ || BOOST_WORKAROUND(__HP_aCC, < 60700) template diff --git a/include/boost/regex/v4/regex_traits.hpp b/include/boost/regex/v4/regex_traits.hpp index 5d427706..ffa2bb68 100644 --- a/include/boost/regex/v4/regex_traits.hpp +++ b/include/boost/regex/v4/regex_traits.hpp @@ -39,7 +39,7 @@ # include # endif #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) # ifndef BOOST_C_REGEX_TRAITS_HPP_INCLUDED # include # endif diff --git a/include/boost/regex/v4/regex_traits_defaults.hpp b/include/boost/regex/v4/regex_traits_defaults.hpp index df9922df..d08047d9 100644 --- a/include/boost/regex/v4/regex_traits_defaults.hpp +++ b/include/boost/regex/v4/regex_traits_defaults.hpp @@ -39,6 +39,7 @@ #include #endif #include +#include #ifdef BOOST_NO_STDC_NAMESPACE namespace std{ @@ -140,7 +141,7 @@ inline bool is_separator(char c) BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name); // -// get the state_id of a character clasification, the individual +// get the state_id of a character classification, the individual // traits classes then transform that state_id into a bitmask: // template @@ -207,8 +208,8 @@ int get_default_class_id(const charT* p1, const charT* p2) {data+63, data+67,}, // word {data+67, data+73,}, // xdigit }; - static const character_pointer_range* ranges_begin = ranges; - static const character_pointer_range* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0])); + const character_pointer_range* ranges_begin = ranges; + const character_pointer_range* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0])); character_pointer_range t = { p1, p2, }; const character_pointer_range* p = std::lower_bound(ranges_begin, ranges_end, t); @@ -240,7 +241,7 @@ inline std::ptrdiff_t global_length(const char* p) template<> inline std::ptrdiff_t global_length(const wchar_t* p) { - return (std::wcslen)(p); + return (std::ptrdiff_t)(std::wcslen)(p); } #endif template @@ -327,17 +328,17 @@ boost::intmax_t global_toi(const charT*& p1, const charT* p2, int radix, const t } template -inline const charT* get_escape_R_string() +inline typename boost::enable_if_c<(sizeof(charT) > 1), const charT*>::type get_escape_R_string() { #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable:4309 4245) #endif - static const charT e1[] = { '(', '?', '>', '\\', 'x', '0', 'D', '\\', 'x', '0', 'A', '?', - '|', '[', '\\', 'x', '0', 'A', '\\', 'x', '0', 'B', '\\', 'x', '0', 'C', static_cast('\x85'), '\\', 'x', '{', '2', '0', '2', '8', '}', - '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' }; - static const charT e2[] = { '(', '?', '>', '\\', 'x', '0', 'D', '\\', 'x', '0', 'A', '?', - '|', '[', '\\', 'x', '0', 'A', '\\', 'x', '0', 'B', '\\', 'x', '0', 'C', static_cast('\x85'), ']', ')', '\0' }; + static const charT e1[] = { '(', '?', '-', 'x', ':', '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', static_cast(0x85), static_cast(0x2028), + static_cast(0x2029), ']', ')', ')', '\0' }; + static const charT e2[] = { '(', '?', '-', 'x', ':', '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', static_cast(0x85), ']', ')', ')', '\0' }; charT c = static_cast(0x2029u); bool b = (static_cast(c) == 0x2029u); @@ -348,15 +349,15 @@ inline const charT* get_escape_R_string() #endif } -template <> -inline const char* get_escape_R_string() +template +inline typename boost::disable_if_c<(sizeof(charT) > 1), const charT*>::type get_escape_R_string() { #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable:4309) #endif - static const char e2[] = { '(', '?', '>', '\\', 'x', '0', 'D', '\\', 'x', '0', 'A', '?', - '|', '[', '\\', 'x', '0', 'A', '\\', 'x', '0', 'B', '\\', 'x', '0', 'C', '\\', 'x', '8', '5', ']', ')', '\0' }; + static const charT e2[] = { '(', '?', '-', 'x', ':', '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', ')', '\0' }; return e2; #ifdef BOOST_MSVC # pragma warning(pop) diff --git a/include/boost/regex/v4/regex_workaround.hpp b/include/boost/regex/v4/regex_workaround.hpp index f245f90d..35eafc25 100644 --- a/include/boost/regex/v4/regex_workaround.hpp +++ b/include/boost/regex/v4/regex_workaround.hpp @@ -198,9 +198,10 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ const char *strSource ) { - if(std::strlen(strSource)+1 > sizeInBytes) + std::size_t lenSourceWithNull = std::strlen(strSource) + 1; + if (lenSourceWithNull > sizeInBytes) return 1; - std::strcpy(strDestination, strSource); + std::memcpy(strDestination, strSource, lenSourceWithNull); return 0; } inline std::size_t strcat_s( @@ -209,9 +210,11 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ const char *strSource ) { - if(std::strlen(strSource) + std::strlen(strDestination) + 1 > sizeInBytes) + std::size_t lenSourceWithNull = std::strlen(strSource) + 1; + std::size_t lenDestination = std::strlen(strDestination); + if (lenSourceWithNull + lenDestination > sizeInBytes) return 1; - std::strcat(strDestination, strSource); + std::memcpy(strDestination + lenDestination, strSource, lenSourceWithNull); return 0; } diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index ff8a8e46..30a580d5 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -50,7 +50,7 @@ struct sub_match : public std::pair sub_match() : std::pair(), matched(false) {} sub_match(BidiIterator i) : std::pair(i, i), matched(false) {} #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\ + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)\ && !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) template operator std::basic_string ()const diff --git a/include/boost/regex/v4/u32regex_token_iterator.hpp b/include/boost/regex/v4/u32regex_token_iterator.hpp index 952f7c41..2e04810d 100644 --- a/include/boost/regex/v4/u32regex_token_iterator.hpp +++ b/include/boost/regex/v4/u32regex_token_iterator.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP #define BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // // Borland C++ Builder 6, and Visual C++ 6, diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index bf996d61..1f38bf36 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -51,8 +51,10 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4786) +#if BOOST_MSVC < 1910 #pragma warning(disable:4800) #endif +#endif namespace boost{ @@ -401,7 +403,7 @@ typename w32_regex_traits_implementation::string_type return pos->second; } #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -411,7 +413,7 @@ typename w32_regex_traits_implementation::string_type #endif name = lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else @@ -544,7 +546,7 @@ typename w32_regex_traits_implementation::char_class_type if(pos != m_custom_class_names.end()) return pos->second; } - std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); + std::size_t state_id = 1u + (std::size_t)BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); if(state_id < sizeof(masks) / sizeof(masks[0])) return masks[state_id]; return masks[0]; diff --git a/performance/table_helper.cpp b/performance/table_helper.cpp index 986c2189..2ff40f1f 100644 --- a/performance/table_helper.cpp +++ b/performance/table_helper.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index a0b52ee4..dd356561 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -23,7 +23,7 @@ #include #include "internals.hpp" -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #include #include @@ -157,7 +157,7 @@ c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits::loo s[i] = static_cast((std::tolower)(static_cast(s[i]))); idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); } - BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0])); + BOOST_ASSERT(std::size_t(idx) + 1u < sizeof(masks) / sizeof(masks[0])); return masks[idx+1]; } diff --git a/src/cregex.cpp b/src/cregex.cpp index 01efc3f3..118c590a 100644 --- a/src/cregex.cpp +++ b/src/cregex.cpp @@ -37,8 +37,8 @@ typedef boost::match_flag_type match_flag_type; namespace boost{ -#ifdef __BORLANDC__ -#if __BORLANDC__ < 0x530 +#ifdef BOOST_BORLANDC +#if BOOST_BORLANDC < 0x530 // // we need to instantiate the vector classes we use // since declaring a reference to type doesn't seem to @@ -70,6 +70,10 @@ inline std::string to_string(const char* i, const char* j) } namespace BOOST_REGEX_DETAIL_NS{ +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif class RegExData { public: @@ -103,6 +107,9 @@ public: #endif strings(), positions() {} }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif void RegExData::update() { @@ -491,8 +498,8 @@ std::size_t RegEx::Position(int i)const { case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched ? pdata->m[i].first - pdata->pbase : RegEx::npos; -#ifndef BOOST_REGEX_NO_FILEITER case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: +#ifndef BOOST_REGEX_NO_FILEITER return pdata->fm[i].matched ? pdata->fm[i].first - pdata->fbase : RegEx::npos; #endif case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: @@ -518,8 +525,8 @@ std::size_t RegEx::Length(int i)const { case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched ? pdata->m[i].second - pdata->m[i].first : RegEx::npos; -#ifndef BOOST_REGEX_NO_FILEITER case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: +#ifndef BOOST_REGEX_NO_FILEITER return pdata->fm[i].matched ? pdata->fm[i].second - pdata->fm[i].first : RegEx::npos; #endif case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: @@ -539,10 +546,10 @@ bool RegEx::Matched(int i)const { case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched; -#ifndef BOOST_REGEX_NO_FILEITER case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: +#ifndef BOOST_REGEX_NO_FILEITER return pdata->fm[i].matched; -#endif +#endif case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: { std::map >::iterator pos = pdata->strings.find(i); @@ -583,7 +590,7 @@ const std::size_t RegEx::npos = ~static_cast(0); } // namespace boost -#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) && (__BORLANDC__ <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE) +#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x550) && (BOOST_BORLANDC <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE) // // this is an ugly hack to work around an ugly problem: // by default this file will produce unresolved externals during diff --git a/src/fileiter.cpp b/src/fileiter.cpp index c48ed657..0c027ec1 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -61,7 +61,7 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ // start with the operating system specific stuff: -#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32) +#if (defined(BOOST_BORLANDC) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32) // platform is DOS or Windows // directories are separated with '\\' @@ -112,16 +112,21 @@ void mapfile::open(const char* file) std::runtime_error err("Unable to create file mapping."); boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } - _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); - if(_first == 0) + else { - CloseHandle(hmap); - CloseHandle(hfile); - hmap = 0; - hfile = 0; - std::runtime_error err("Unable to create file mapping."); + _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); + if (_first == 0) + { + CloseHandle(hmap); + CloseHandle(hfile); + hmap = 0; + hfile = 0; + std::runtime_error err("Unable to create file mapping."); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); + } + else + _last = _first + GetFileSize(hfile, 0); } - _last = _first + GetFileSize(hfile, 0); } else { @@ -832,7 +837,7 @@ bool iswild(const char* mask, const char* name) ++mask; continue; } - // fall through: + // fall through default: if(BOOST_REGEX_FI_TRANSLATE(*mask) != BOOST_REGEX_FI_TRANSLATE(*name)) return false; diff --git a/src/icu.cpp b/src/icu.cpp index d101d65d..cb11f323 100644 --- a/src/icu.cpp +++ b/src/icu.cpp @@ -354,8 +354,8 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha }; - static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data; - static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0])); + const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data; + const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0])); BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, }; const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t); @@ -481,7 +481,7 @@ icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_ty bool icu_regex_traits::isctype(char_type c, char_class_type f) const { // check for standard catagories first: - char_class_type m = char_class_type(1uLL << u_charType(c)); + char_class_type m = char_class_type(static_cast(1) << u_charType(c)); if((m & f) != 0) return true; // now check for special cases: diff --git a/src/instances.cpp b/src/instances.cpp index 69d72ad6..88502b19 100644 --- a/src/instances.cpp +++ b/src/instances.cpp @@ -23,7 +23,7 @@ #if !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES) #define BOOST_REGEX_NARROW_INSTANTIATE -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma hrdstop #endif diff --git a/src/posix_api.cpp b/src/posix_api.cpp index 1531d948..47133fa0 100644 --- a/src/posix_api.cpp +++ b/src/posix_api.cpp @@ -66,6 +66,10 @@ const char* names[] = { typedef boost::basic_regex > c_regex_type; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char* ptr, int f) { #ifndef BOOST_NO_EXCEPTIONS @@ -140,6 +144,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char return result; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, regsize_t buf_size) { diff --git a/src/regex.cpp b/src/regex.cpp index e9e97627..ee0204cc 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -28,7 +28,9 @@ # include #endif #ifdef BOOST_REGEX_HAS_MS_STACK_GUARD -#define WIN32_LEAN_AND_MEAN +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif #ifndef NOMINMAX # define NOMINMAX #endif @@ -70,7 +72,7 @@ regex_error::regex_error(regex_constants::error_type err) { } -regex_error::~regex_error() throw() +regex_error::~regex_error() BOOST_NOEXCEPT_OR_NOTHROW { } diff --git a/src/regex_traits_defaults.cpp b/src/regex_traits_defaults.cpp index 0b66c68d..5ac46d2d 100644 --- a/src/regex_traits_defaults.cpp +++ b/src/regex_traits_defaults.cpp @@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l // // these are the POSIX collating names: // -BOOST_REGEX_DECL const char* def_coll_names[] = { +static const char* def_coll_names[] = { "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline", "vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark", @@ -214,7 +214,7 @@ BOOST_REGEX_DECL const char* def_coll_names[] = { // little more - but this will have to do for // now: -BOOST_REGEX_DECL const char* def_multi_coll[] = { +static const char* def_multi_coll[] = { "ae", "Ae", "AE", diff --git a/src/static_mutex.cpp b/src/static_mutex.cpp index d02b01fc..35dd0c79 100644 --- a/src/static_mutex.cpp +++ b/src/static_mutex.cpp @@ -28,7 +28,9 @@ #ifndef NOMINMAX # define NOMINMAX #endif -#define WIN32_LEAN_AND_MEAN +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif #include #include #endif diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index 0f825702..5b5236aa 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -23,7 +23,9 @@ #include #include -#define WIN32_LEAN_AND_MEAN +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif #ifndef NOMINMAX # define NOMINMAX #endif diff --git a/src/wc_regex_traits.cpp b/src/wc_regex_traits.cpp index e7fcfb8e..aa5b028a 100644 --- a/src/wc_regex_traits.cpp +++ b/src/wc_regex_traits.cpp @@ -71,7 +71,7 @@ template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>( #include #include -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #include #ifndef BOOST_NO_WREGEX @@ -224,7 +224,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l { #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -235,7 +235,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else @@ -257,7 +257,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l int BOOST_REGEX_CALL c_regex_traits::value(wchar_t c, int radix) { -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC // workaround for broken wcstol: if((std::iswxdigit)(c) == 0) return -1; @@ -310,5 +310,5 @@ int BOOST_REGEX_CALL c_regex_traits::value(unsigned short c, int #endif // BOOST_NO_WREGEX -#endif // __BORLANDC__ +#endif // BOOST_BORLANDC diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index bc1c0af2..c675104b 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -76,6 +76,10 @@ const wchar_t* wnames[] = { typedef boost::basic_regex > wc_regex_type; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f) { #ifndef BOOST_NO_EXCEPTIONS @@ -150,6 +154,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha return result; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, regsize_t buf_size) { diff --git a/src/winstances.cpp b/src/winstances.cpp index 1e0b8596..beaf0ea5 100644 --- a/src/winstances.cpp +++ b/src/winstances.cpp @@ -23,7 +23,7 @@ #if !defined(BOOST_NO_WREGEX) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES) #define BOOST_REGEX_WIDE_INSTANTIATE -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma hrdstop #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f485058c..49ed730b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -19,7 +19,7 @@ project U_USING_ICU_NAMESPACE=0 #gcc-mw:static #gcc-mingw:static - gcc-cygwin:static + #gcc-cygwin:static sun:static ; @@ -196,3 +196,8 @@ build-project ../example ; # `quick` target (for CI) run quick.cpp ../build//boost_regex ; + +compile test_warnings.cpp + : msvc:all msvc:on + gcc:all gcc:on + clang:all clang:on ; diff --git a/test/c_compiler_checks/posix_api_check.c b/test/c_compiler_checks/posix_api_check.c index c12525c8..34abca14 100644 --- a/test/c_compiler_checks/posix_api_check.c +++ b/test/c_compiler_checks/posix_api_check.c @@ -39,7 +39,7 @@ int main() { char buf[256]; regerrorA(result, &re, buf, sizeof(buf)); - printf(buf); + puts(buf); return result; } assert(re.re_nsub == 0); @@ -50,7 +50,7 @@ int main() { char buf[256]; regerrorA(result, &re, buf, sizeof(buf)); - printf(buf); + puts(buf); regfreeA(&re); return result; } diff --git a/test/c_compiler_checks/wide_posix_api_check.c b/test/c_compiler_checks/wide_posix_api_check.c index 096d929a..cd1a287d 100644 --- a/test/c_compiler_checks/wide_posix_api_check.c +++ b/test/c_compiler_checks/wide_posix_api_check.c @@ -50,7 +50,7 @@ int main() regerror(result, &re, buf, sizeof(buf)); for(i = 0; i < 256; ++i) nbuf[i] = (char)(buf[i]); - printf(nbuf); + puts(nbuf); return result; } if(re.re_nsub != 0) @@ -66,7 +66,7 @@ int main() regerror(result, &re, buf, sizeof(buf)); for(i = 0; i < 256; ++i) nbuf[i] = (char)(buf[i]); - printf(nbuf); + puts(nbuf); regfree(&re); return result; } diff --git a/test/captures/captures_test.cpp b/test/captures/captures_test.cpp index 63f58c9c..56aec674 100644 --- a/test/captures/captures_test.cpp +++ b/test/captures/captures_test.cpp @@ -29,9 +29,9 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) template -int array_size(const char* (&p)[N]) +size_t array_size(const char* (&p)[N]) { - for(int i = 0; i < N; ++i) + for(size_t i = 0; i < N; ++i) if(p[i] == 0) return i; return N; @@ -68,6 +68,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected } } } + +#if !defined(BOOST_NO_WREGEX) std::wstring wre(regx.begin(), regx.end()); std::wstring wtext(text.begin(), text.end()); @@ -89,6 +91,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected } } } + +#endif #ifdef BOOST_HAS_ICU boost::u32regex ure = boost::make_u32regex(regx); diff --git a/test/collate_info/collate_info.cpp b/test/collate_info/collate_info.cpp index da96745c..be014298 100644 --- a/test/collate_info/collate_info.cpp +++ b/test/collate_info/collate_info.cpp @@ -230,7 +230,7 @@ int cpp_main(int /*argc*/, char * /*argv*/[]) print_cpp_info(wchar_t(0), "wchar_t"); #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) boost::c_regex_traits a; print_sort_syntax(a, "boost::c_regex_traits"); #ifndef BOOST_NO_WREGEX diff --git a/test/concepts/concept_check.cpp b/test/concepts/concept_check.cpp index 21448f21..ed06feff 100644 --- a/test/concepts/concept_check.cpp +++ b/test/concepts/concept_check.cpp @@ -15,7 +15,7 @@ // this lets us compile at warning level 4 without seeing concept-check related warnings # pragma warning(disable:4100) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option -w-8019 -w-8004 -w-8008 #endif #ifdef BOOST_INTEL @@ -53,7 +53,7 @@ int main() >(); #endif #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) boost::function_requires< boost::BoostRegexConcept< boost::basic_regex > diff --git a/test/concepts/icu_concept_check.cpp b/test/concepts/icu_concept_check.cpp index a55bb387..a2fe627a 100644 --- a/test/concepts/icu_concept_check.cpp +++ b/test/concepts/icu_concept_check.cpp @@ -21,7 +21,7 @@ // this lets us compile at warning level 4 without seeing concept-check related warnings # pragma warning(disable:4100) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option -w-8019 -w-8004 -w-8008 #endif diff --git a/test/named_subexpressions/named_subexpressions_test.cpp b/test/named_subexpressions/named_subexpressions_test.cpp index a92c02b8..5bd38fbc 100644 --- a/test/named_subexpressions/named_subexpressions_test.cpp +++ b/test/named_subexpressions/named_subexpressions_test.cpp @@ -106,7 +106,9 @@ void test_named_subexpressions(charT) int cpp_main( int , char* [] ) { test_named_subexpressions(char(0)); +#if !defined(BOOST_NO_WREGEX) test_named_subexpressions(wchar_t(0)); +#endif return 0; } diff --git a/test/regress/basic_tests.cpp b/test/regress/basic_tests.cpp index 25f00c24..a1a3e817 100644 --- a/test/regress/basic_tests.cpp +++ b/test/regress/basic_tests.cpp @@ -18,7 +18,7 @@ #include -#if BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) // we get unresolved externals from basic_string // unless we do this, a well known Borland bug: #define _RWSTD_COMPILE_INSTANTIATE diff --git a/test/regress/info.hpp b/test/regress/info.hpp index 5c08961e..beca8e5d 100644 --- a/test/regress/info.hpp +++ b/test/regress/info.hpp @@ -112,7 +112,7 @@ private: boost::call_once(f,&init_data); return do_get_data(); #else - static data_type d; + static data_type d = {}; return d; #endif } diff --git a/test/regress/main.cpp b/test/regress/main.cpp index e3e3dd7f..87ad9ff4 100644 --- a/test/regress/main.cpp +++ b/test/regress/main.cpp @@ -139,10 +139,10 @@ int cpp_main(int /*argc*/, char * /*argv*/[]) int* get_array_data() { - static boost::thread_specific_ptr > tp; + static boost::thread_specific_ptr > tp; if(tp.get() == 0) - tp.reset(new boost::array); + tp.reset(new boost::array); return tp.get()->data(); } @@ -160,9 +160,9 @@ const int* make_array(int first, ...) #ifdef TEST_THREADS int* data = get_array_data(); #else - static int data[200]; + static int data[800]; #endif - std::fill_n(data, 200, -2); + std::fill_n(data, 800, -2); va_list ap; va_start(ap, first); // diff --git a/test/regress/test.hpp b/test/regress/test.hpp index d9224e8e..e9a1b862 100644 --- a/test/regress/test.hpp +++ b/test/regress/test.hpp @@ -99,11 +99,11 @@ void do_test(const charT& c, const tagT& tag) boost::call_once(f, proc); #endif if(test_locale::cpp_locale_state() == test_locale::test_with_locale) - e1.imbue(test_locale::cpp_locale()); + (void)e1.imbue(test_locale::cpp_locale()); if(test_locale::cpp_locale_state() != test_locale::no_test) test(e1, tag); #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) && defined(TEST_THREADS) // typeid appears to fail in multithreaded environments: test_info::set_typename(""); diff --git a/test/regress/test_anchors.cpp b/test/regress/test_anchors.cpp index b2aabdfd..e695f920 100644 --- a/test/regress/test_anchors.cpp +++ b/test/regress/test_anchors.cpp @@ -59,7 +59,7 @@ void test_anchors() // TEST_REGEX_SEARCH("^.", boost::regex::extended, " \n \r\n ", match_default, make_array(0, 1, -2, 3, 4, -2, 7, 8, -2, -2)); TEST_REGEX_SEARCH(".$", boost::regex::extended, " \n \r\n ", match_default, make_array(1, 2, -2, 4, 5, -2, 8, 9, -2, -2)); -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"^.", boost::regex::extended, L"\x2028 \x2028", match_default, make_array(0, 1, -2, 1, 2, -2, -2)); TEST_REGEX_SEARCH_W(L".$", boost::regex::extended, L" \x2028 \x2028", match_default, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2)); #endif diff --git a/test/regress/test_backrefs.cpp b/test/regress/test_backrefs.cpp index 58f4dedb..be9f54ca 100644 --- a/test/regress/test_backrefs.cpp +++ b/test/regress/test_backrefs.cpp @@ -103,5 +103,10 @@ void test_backrefs() TEST_REGEX_SEARCH("a(?'foo'(?'bar'(?'bb'(?'aa'b*))))c\\g{foo}d", perl, "abbcbbbd", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH("^(?'foo'.)\\g{foo}", perl, "abc", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH("a(?'foo'[bc])\\g{foo}d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2)); + + // Bug cases from https://github.com/boostorg/regex/issues/75 + TEST_REGEX_SEARCH("(?:(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)\\g{-1}|WORKING)", perl, "WORKING", match_default, make_array(0, 7, -2, -2)); + TEST_REGEX_SEARCH("(?:(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)\\g{-1}|WORKING)", perl, "WORKING", match_default, make_array(0, 7, -2, -2)); + } diff --git a/test/regress/test_escapes.cpp b/test/regress/test_escapes.cpp index 2511fcfe..74212677 100644 --- a/test/regress/test_escapes.cpp +++ b/test/regress/test_escapes.cpp @@ -61,7 +61,7 @@ void test_character_escapes() TEST_REGEX_SEARCH("a\\Q+*?\\\\Eb", perl, "a+*?\\b", match_default, make_array(0, 6, -2, -2)); TEST_REGEX_SEARCH("\\C+", perl, "abcde", match_default, make_array(0, 5, -2, -2)); TEST_REGEX_SEARCH("\\X+", perl, "abcde", match_default, make_array(0, 5, -2, -2)); -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"\\X", perl, L"a\x0300\x0301", match_default, make_array(0, 3, -2, -2)); #endif // unknown escape sequences match themselves: @@ -169,5 +169,48 @@ void test_assertion_escapes() TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl, L"abc\u2028bar", match_default, make_array(0, 4, -2, -2)); TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl, L"abc\u2029bar", match_default, make_array(0, 4, -2, -2)); } + // Bug report: https://github.com/boostorg/regex/issues/40 + TEST_REGEX_SEARCH("\\b", perl, "", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "", match_not_bow | match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "-", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "-", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "-", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\b", perl, "-", match_not_bow | match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "", match_not_bow | match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "-", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "-", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "-", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\<", perl, "-", match_not_bow | match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "", match_not_bow | match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "-", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "-", match_not_bow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "-", match_not_eow, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\>", perl, "-", match_not_bow | match_not_eow, make_array(-2, -2)); + // Bug report https://github.com/boostorg/regex/issues/57 + // Line ending \R: + TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\nbar", match_default, make_array(3, 4, -2, -2)); + TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\rbar", match_default, make_array(3, 4, -2, -2)); + TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\r\nbar", match_default, make_array(3, 5, -2, -2)); + TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\r\nbar", match_default, make_array(0, 5, -2, -2)); + TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\012bar", match_default, make_array(0, 4, -2, -2)); + TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\013bar", match_default, make_array(0, 4, -2, -2)); + TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\013bar", match_default, make_array(0, 4, -2, -2)); + TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\205bar", match_default, make_array(0, 4, -2, -2)); + // see if \u works: + if(*w == 0x2028u) + { + TEST_REGEX_SEARCH_W(L"\\R", perl | no_escape_in_lists, L"foo\u2028bar", match_default, make_array(3, 4, -2, -2)); + TEST_REGEX_SEARCH_W(L"\\R", perl | no_escape_in_lists, L"foo\u2029bar", match_default, make_array(3, 4, -2, -2)); + TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl | no_escape_in_lists, L"abc\u2028bar", match_default, make_array(0, 4, -2, -2)); + TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl | no_escape_in_lists, L"abc\u2029bar", match_default, make_array(0, 4, -2, -2)); + } } diff --git a/test/regress/test_locale.cpp b/test/regress/test_locale.cpp index 692d83e6..36ab7443 100644 --- a/test/regress/test_locale.cpp +++ b/test/regress/test_locale.cpp @@ -49,7 +49,9 @@ test_locale::test_locale(const char* c_name, boost::uint32_t lcid) #else s_c_locale = no_test; #endif -#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_EXCEPTIONS) + // Disabled for VC15.7 (and later?) as the C runtime asserts if you pass an invalid + // locale name to std::locale, rather than throwing the expected exception. +#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_EXCEPTIONS) && !BOOST_WORKAROUND(BOOST_MSVC, > 1913) // back up the C++ locale and create the new one: m_old_cpp_locale = s_cpp_locale_inst; m_old_cpp_state = s_cpp_locale; @@ -186,7 +188,7 @@ void test_en_locale(const char* name, boost::uint32_t lcid) TEST_REGEX_SEARCH_L("[[:graph:]]+", perl, "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe", match_default, make_array(0, 93, -2, -2)); TEST_REGEX_SEARCH_L("[[:word:]]+", perl, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe", match_default, make_array(0, 61, -2, -2)); // collation sensitive ranges: -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600) // these tests are disabled for Borland C++: a bug in std::collate // causes these tests to crash (pointer overrun in std::collate::do_transform). TEST_REGEX_SEARCH_L("[a-z]+", perl|::boost::regex_constants::collate, "\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc", match_default, make_array(0, 28, -2, -2)); diff --git a/test/regress/test_perl_ex.cpp b/test/regress/test_perl_ex.cpp index 6a53256d..2a7310cd 100644 --- a/test/regress/test_perl_ex.cpp +++ b/test/regress/test_perl_ex.cpp @@ -935,6 +935,7 @@ void test_recursion() TEST_REGEX_SEARCH("namespace\\s+(\\w+)\\s+(\\{(?:[^{}]*(?:(?2)[^{}]*)*)?\\})", perl, "namespace one { namespace two { int foo(){} } { {{{ } } } } {}}", match_default, make_array(0, 64, 10, 13, 14, 64, -2, -2)); TEST_INVALID_REGEX("((?1)|a)", perl); TEST_REGEX_SEARCH("a(?0)?", perl, "aaaaa", match_default, make_array(0, 5, -2, -2)); + TEST_REGEX_SEARCH("((?(DEFINE)(?'a'A)(?'b'(?&a)?(?&a)))(?&b)?)", perl, "AA", match_default, make_array(0, 2, 0, 2, -1, -1, -2, 2, 2, 2, 2, -1, -1, -2, -2)); // Recursion to a named sub with a name that is used multiple times: TEST_REGEX_SEARCH("(?:(?a+)|(?b+))\\.(?&A)", perl, "aaaa.aa", match_default, make_array(0, 7, 0, 4, -1, -1, -2, -2)); diff --git a/test/regress/test_tricky_cases.cpp b/test/regress/test_tricky_cases.cpp index f9cc25d1..7ca90921 100644 --- a/test/regress/test_tricky_cases.cpp +++ b/test/regress/test_tricky_cases.cpp @@ -276,7 +276,7 @@ void test_tricky_cases3() // posix only: TEST_REGEX_SEARCH("^[[:blank:]]*#([^\\n]*\\\\[[:space:]]+)*[^\\n]*", awk, "#define some_symbol(x) \\ \r\n foo();\\\r\n printf(#x);", match_default, make_array(0, 53, 28, 42, -2, -2)); // now try and test some unicode specific characters: -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"[[:unicode:]]+", perl, L"a\x0300\x0400z", match_default, make_array(1, 3, -2, -2)); TEST_REGEX_SEARCH_W(L"[\x10-\xff]", perl, L"\x0300\x0400", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH_W(L"[\01-\05]{5}", perl, L"\x0300\x0400\x0300\x0400\x0300\x0400", match_default, make_array(-2, -2)); diff --git a/test/test_macros.hpp b/test/test_macros.hpp index d8772965..ef28fe0a 100644 --- a/test/test_macros.hpp +++ b/test/test_macros.hpp @@ -65,8 +65,8 @@ void report_unexpected_exception(const E& e, int severity, const char* file, int } #define BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity) \ - catch(const std::exception& e) \ - { report_unexpected_exception(e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); }\ + catch(const std::exception& __e) \ + { report_unexpected_exception(__e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); }\ catch(...)\ { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Exception of unknown type was thrown" << std::endl; report_severity(severity); } diff --git a/test/test_warnings.cpp b/test/test_warnings.cpp new file mode 100644 index 00000000..f85d437d --- /dev/null +++ b/test/test_warnings.cpp @@ -0,0 +1,29 @@ +/* +* +* Copyright (c) 2018 +* John Maddock +* +* Use, modification and distribution are subject to 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) +* +*/ + + +#ifdef _MSC_VER +#pragma warning(disable:4820 4668) +#endif + +#ifdef __APPLE_CC__ +#pragma clang diagnostic ignored "-Wc++11-long-long" +#endif + +#include + +void test_proc() +{ + std::string text, re; + boost::regex exp(re); + regex_match(text, exp); +} + diff --git a/test/unicode/unicode_iterator_test.cpp b/test/unicode/unicode_iterator_test.cpp index 243ef742..2e6bcec1 100644 --- a/test/unicode/unicode_iterator_test.cpp +++ b/test/unicode/unicode_iterator_test.cpp @@ -157,22 +157,30 @@ void spot_checks() void test(const std::vector< ::boost::uint32_t>& v) { typedef std::vector< ::boost::uint32_t> vector32_type; +#ifdef TEST_UTF16 typedef std::vector< ::boost::uint16_t> vector16_type; +#endif typedef std::vector< ::boost::uint8_t> vector8_type; +#ifdef TEST_UTF16 typedef boost::u32_to_u16_iterator u32to16type; typedef boost::u16_to_u32_iterator u16to32type; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR) && !defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) typedef std::reverse_iterator ru32to16type; typedef std::reverse_iterator ru16to32type; #endif +#endif // TEST_UTF16 +#ifdef TEST_UTF8 typedef boost::u32_to_u8_iterator u32to8type; typedef boost::u8_to_u32_iterator u8to32type; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR) && !defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) typedef std::reverse_iterator ru32to8type; typedef std::reverse_iterator ru8to32type; #endif +#endif // TEST_UTF8 vector8_type v8; +#ifdef TEST_UTF16 vector16_type v16; +#endif vector32_type v32; vector32_type::const_iterator i, j, k;