From a3ca728471705109ba82dcb3b10516f6a3c2f948 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 19 Mar 2021 03:49:19 +0200 Subject: [PATCH 001/110] Add -DBUILD_TESTING=ON to .yml files; it's not default anymore --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ced831b..3afe36c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -324,7 +324,7 @@ matrix: env: CMAKE=1 script: - mkdir __build__ && cd __build__ - - cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. + - cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. - ctest --output-on-failure -R boost_assert - os: linux diff --git a/appveyor.yml b/appveyor.yml index 7203084..9793876 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -61,7 +61,7 @@ test_script: - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - - if not "%CMAKE%" == "" cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. + - if not "%CMAKE%" == "" cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C Debug - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C Release - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C MinSizeRel From 6047fd69d39a81c4296ba27ee09f22dd0f7671f8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 19 Apr 2021 18:07:18 +0300 Subject: [PATCH 002/110] Update .github/workflows --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ea2fde..b044f6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: - toolset: gcc-8 cxxstd: "03,11,14,17,2a" os: ubuntu-18.04 + install: g++-8 - toolset: gcc-9 cxxstd: "03,11,14,17,2a" os: ubuntu-18.04 @@ -87,6 +88,7 @@ jobs: compiler: clang++-6.0 cxxstd: "03,11,14,17" os: ubuntu-18.04 + install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "03,11,14,17" @@ -96,6 +98,7 @@ jobs: compiler: clang++-8 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + install: clang-8 - toolset: clang compiler: clang++-9 cxxstd: "03,11,14,17,2a" @@ -104,6 +107,10 @@ jobs: compiler: clang++-10 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + - toolset: clang + compiler: clang++-11 + cxxstd: "03,11,14,17,2a" + os: ubuntu-20.04 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-10.15 From 10b57954282807a546bfd123e887f1d751df972d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 02:09:59 +0300 Subject: [PATCH 003/110] Update CMakeLists.txt --- CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0066aeb..f4ccdd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,16 +17,6 @@ target_link_libraries(boost_assert Boost::config ) -# boost_install requires PROJECT_VERSION -# Without the superproject, we don't have any, so skip installation - -if(BOOST_SUPERPROJECT_VERSION) - - include(BoostInstall) - boost_install(TARGETS boost_assert HEADER_DIRECTORY include/) - -endif() - # BUILD_TESTING is the standard CTest variable that enables testing if(BUILD_TESTING) From f6c89f7acdfe83e8e88cff2bb8e9efe7e330e203 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 04:28:36 +0300 Subject: [PATCH 004/110] Update ci.yml --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b044f6b..6bf77ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,10 @@ jobs: - toolset: gcc-10 cxxstd: "03,11,14,17,2a" os: ubuntu-18.04 + - toolset: gcc-11 + cxxstd: "03,11,14,17,2a" + os: ubuntu-18.04 + install: g++-11 - toolset: clang compiler: clang++-3.5 cxxstd: "03,11,14" @@ -103,6 +107,7 @@ jobs: compiler: clang++-9 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + install: clang-9 - toolset: clang compiler: clang++-10 cxxstd: "03,11,14,17,2a" @@ -111,6 +116,10 @@ jobs: compiler: clang++-11 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + - toolset: clang + compiler: clang++-12 + cxxstd: "03,11,14,17,2a" + os: ubuntu-20.04 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-10.15 From 3f9f17af50aa192276e0bfccdb3ce47cf22c2210 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 06:25:14 +0300 Subject: [PATCH 005/110] Update .travis.yml, appveyor.yml --- .travis.yml | 7 ++++--- appveyor.yml | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3afe36c..d58b198 100644 --- a/.travis.yml +++ b/.travis.yml @@ -324,8 +324,9 @@ matrix: env: CMAKE=1 script: - mkdir __build__ && cd __build__ - - cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. - - ctest --output-on-failure -R boost_assert + - cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. + - cmake --build . --target tests + - ctest --output-on-failure - os: linux env: CMAKE_SUBDIR=1 @@ -342,7 +343,7 @@ matrix: env: CMAKE_INSTALL=1 script: - mkdir __build__ && cd __build__ - - cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert -DCMAKE_INSTALL_PREFIX=~/.local .. + - cmake -DBOOST_INCLUDE_LIBRARIES=assert -DCMAKE_INSTALL_PREFIX=~/.local .. - cmake --build . --target install - cd ../libs/assert/test/cmake_install_test && mkdir __build__ && cd __build__ - cmake -DCMAKE_INSTALL_PREFIX=~/.local .. diff --git a/appveyor.yml b/appveyor.yml index 9793876..c42111a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -61,11 +61,11 @@ test_script: - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - - if not "%CMAKE%" == "" cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=assert .. - - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C Debug - - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C Release - - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C MinSizeRel - - if not "%CMAKE%" == "" ctest --output-on-failure -R boost_assert -C RelWithDebInfo + - if not "%CMAKE%" == "" cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. + - if not "%CMAKE%" == "" cmake --build . --target tests --config Debug & ctest --output-on-failure -C Debug + - if not "%CMAKE%" == "" cmake --build . --target tests --config Release & ctest --output-on-failure -C Release + - if not "%CMAKE%" == "" cmake --build . --target tests --config MinSizeRel & ctest --output-on-failure -C MinSizeRel + - if not "%CMAKE%" == "" cmake --build . --target tests --config RelWithDebInfo & ctest --output-on-failure -C RelWithDebInfo - if not "%CMAKE_SUBDIR%" == "" cd libs/assert/test/cmake_subdir_test && mkdir __build__ && cd __build__ - if not "%CMAKE_SUBDIR%" == "" cmake .. @@ -75,7 +75,7 @@ test_script: - if not "%CMAKE_SUBDIR%" == "" cmake --build . --config RelWithDebInfo && cmake --build . --target check --config RelWithDebInfo - if not "%CMAKE_INSTALL%" == "" mkdir __build__ && cd __build__ - - if not "%CMAKE_INSTALL%" == "" cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES="assert;config" -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. + - if not "%CMAKE_INSTALL%" == "" cmake -DBOOST_INCLUDE_LIBRARIES=assert -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. - if not "%CMAKE_INSTALL%" == "" cmake --build . --target install --config Debug - if not "%CMAKE_INSTALL%" == "" cmake --build . --target install --config Release - if not "%CMAKE_INSTALL%" == "" cd ../libs/assert/test/cmake_install_test && mkdir __build__ && cd __build__ From e2fa62c4d8fea2993a8ede40a5152d5c040ff3b6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 16:41:28 +0300 Subject: [PATCH 006/110] Take care of gcc-4.4 in addition to gcc-4.4.7 --- test/Jamfile.v2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 0e935b6..b7a9bfc 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -14,7 +14,9 @@ project : requirements clang:on gcc:on gcc:-Wshadow - gcc-4.4.7:-Wno-sign-compare ; + gcc-4.4.7:-Wno-sign-compare + gcc-4.4:-Wno-sign-compare +; run assert_test.cpp ; run current_function_test.cpp From 6aabfebae6d4acf996fe711de4e9b444ad88c17d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 11 Jun 2021 16:10:55 +0300 Subject: [PATCH 007/110] Update CMake when testing installation on Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d58b198..94f0f74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -342,6 +342,7 @@ matrix: - os: linux env: CMAKE_INSTALL=1 script: + - pip install --user cmake - mkdir __build__ && cd __build__ - cmake -DBOOST_INCLUDE_LIBRARIES=assert -DCMAKE_INSTALL_PREFIX=~/.local .. - cmake --build . --target install From b7a43990e637d87b816be9b304f0c81a5bebb2ea Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 00:45:15 +0300 Subject: [PATCH 008/110] Add source_location::to_string --- include/boost/assert/source_location.hpp | 55 ++++++++++++++++-------- test/source_location_test3.cpp | 12 +++++- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index c6c3e78..fdf943e 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -1,16 +1,17 @@ #ifndef BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED #define BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED -// http://www.boost.org/libs/assert +// http://www.boost.org/libs/assert // -// Copyright 2019 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// http://www.boost.org/LICENSE_1_0.txt +// Copyright 2019, 2021 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt #include #include #include #include +#include namespace boost { @@ -53,28 +54,48 @@ struct source_location { return column_; } -}; -template std::basic_ostream & operator<<( std::basic_ostream & os, source_location const & loc ) -{ - os.width( 0 ); +#if defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable: 4996 ) +#endif - if( loc.line() == 0 ) + std::string to_string() const { - os << "(unknown source location)"; - } - else - { - os << loc.file_name() << ':' << loc.line(); + if( line() == 0 ) + { + return "(unknown source location)"; + } + + std::string r = file_name(); - if( loc.column() ) + char buffer[ 16 ]; + + sprintf( buffer, ":%ld", static_cast( line() ) ); + r += buffer; + + if( column() ) { - os << ':' << loc.column(); + sprintf( buffer, ":%ld", static_cast( column() ) ); + r += buffer; } - os << ": in function '" << loc.function_name() << '\''; + r += " in function '"; + r += function_name(); + r += '\''; + + return r; } +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif + +}; + +template std::basic_ostream & operator<<( std::basic_ostream & os, source_location const & loc ) +{ + os << loc.to_string(); return os; } diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index 72a2289..f2247cc 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -8,6 +8,11 @@ int main() { + { + boost::source_location loc; + BOOST_TEST_EQ( loc.to_string(), std::string( "(unknown source location)" ) ); + } + { boost::source_location loc; @@ -17,13 +22,18 @@ int main() BOOST_TEST_EQ( os.str(), std::string( "(unknown source location)" ) ); } + { + boost::source_location loc = BOOST_CURRENT_LOCATION; + BOOST_TEST_EQ( loc.to_string(), std::string( __FILE__ ) + ":26 in function '" + BOOST_CURRENT_FUNCTION + "'" ); + } + { boost::source_location loc = BOOST_CURRENT_LOCATION; std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":21: in function '" + BOOST_CURRENT_FUNCTION + "'" ); + BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":31 in function '" + BOOST_CURRENT_FUNCTION + "'" ); } return boost::report_errors(); From 0b10245ee58eac483d7fe691f77b371f7247c71e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 00:47:28 +0300 Subject: [PATCH 009/110] Add CMake tests to ci.yml --- .github/workflows/ci.yml | 156 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bf77ce..ee125ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,3 +215,159 @@ jobs: run: | cd ../boost-root b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release + + posix-cmake-subdir: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-18.04 + - os: ubuntu-20.04 + - os: macos-10.15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v2 + + - name: Install packages + if: matrix.install + run: sudo apt install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Use library with add_subdirectory + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test + mkdir __build__ && cd __build__ + cmake .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-install: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-18.04 + - os: ubuntu-20.04 + - os: macos-10.15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v2 + + - name: Install packages + if: matrix.install + run: sudo apt install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local .. + + - name: Install + run: | + cd ../boost-root/__build__ + cmake --build . --target install + + - name: Use the installed library + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=~/.local .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-18.04 + - os: ubuntu-20.04 + - os: macos-10.15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v2 + + - name: Install packages + if: matrix.install + run: sudo apt install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON .. + + - name: Build tests + run: | + cd ../boost-root/__build__ + cmake --build . --target tests + + - name: Run tests + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error From 1f98fab0bfecc5fe3999fa96d396cf7155d43022 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 01:06:02 +0300 Subject: [PATCH 010/110] Include ; qualify std::sprintf --- include/boost/assert/source_location.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index fdf943e..162d788 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace boost { @@ -71,12 +72,12 @@ struct source_location char buffer[ 16 ]; - sprintf( buffer, ":%ld", static_cast( line() ) ); + std::sprintf( buffer, ":%ld", static_cast( line() ) ); r += buffer; if( column() ) { - sprintf( buffer, ":%ld", static_cast( column() ) ); + std::sprintf( buffer, ":%ld", static_cast( column() ) ); r += buffer; } From aefcf15935f4d7292d7fb5981cadda678ab109f1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 02:52:56 +0300 Subject: [PATCH 011/110] Remove ubuntu-16.04 --- .github/workflows/ci.yml | 51 +++++++++++----------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee125ae..8028406 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,24 +17,17 @@ jobs: fail-fast: false matrix: include: - - toolset: gcc-4.7 - cxxstd: "03,11" - os: ubuntu-16.04 - install: g++-4.7 - toolset: gcc-4.8 cxxstd: "03,11" - os: ubuntu-16.04 + os: ubuntu-18.04 install: g++-4.8 - - toolset: gcc-4.9 - cxxstd: "03,11" - os: ubuntu-16.04 - install: g++-4.9 - toolset: gcc-5 cxxstd: "03,11,14,1z" - os: ubuntu-16.04 + os: ubuntu-18.04 + install: g++-5 - toolset: gcc-6 cxxstd: "03,11,14,1z" - os: ubuntu-16.04 + os: ubuntu-18.04 install: g++-6 - toolset: gcc-7 cxxstd: "03,11,14,17" @@ -45,48 +38,29 @@ jobs: install: g++-8 - toolset: gcc-9 cxxstd: "03,11,14,17,2a" - os: ubuntu-18.04 + os: ubuntu-20.04 - toolset: gcc-10 cxxstd: "03,11,14,17,2a" - os: ubuntu-18.04 + os: ubuntu-20.04 + install: g++-10 - toolset: gcc-11 cxxstd: "03,11,14,17,2a" - os: ubuntu-18.04 + os: ubuntu-20.04 install: g++-11 - - toolset: clang - compiler: clang++-3.5 - cxxstd: "03,11,14" - os: ubuntu-16.04 - install: clang-3.5 - - toolset: clang - compiler: clang++-3.6 - cxxstd: "03,11,14" - os: ubuntu-16.04 - install: clang-3.6 - - toolset: clang - compiler: clang++-3.7 - cxxstd: "03,11,14" - os: ubuntu-16.04 - install: clang-3.7 - - toolset: clang - compiler: clang++-3.8 - cxxstd: "03,11,14" - os: ubuntu-16.04 - install: clang-3.8 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" - os: ubuntu-16.04 + os: ubuntu-18.04 install: clang-3.9 - toolset: clang compiler: clang++-4.0 cxxstd: "03,11,14" - os: ubuntu-16.04 + os: ubuntu-18.04 install: clang-4.0 - toolset: clang compiler: clang++-5.0 cxxstd: "03,11,14,1z" - os: ubuntu-16.04 + os: ubuntu-18.04 install: clang-5.0 - toolset: clang compiler: clang++-6.0 @@ -112,14 +86,17 @@ jobs: compiler: clang++-10 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + install: clang-10 - toolset: clang compiler: clang++-11 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + install: clang-11 - toolset: clang compiler: clang++-12 cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 + install: clang-12 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-10.15 From a0d8040e939d7811affc0b459a32d20642771059 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 03:37:51 +0300 Subject: [PATCH 012/110] Update documentation --- doc/changes.adoc | 6 +++++- doc/index.adoc | 2 +- doc/source_location.adoc | 38 ++++++++++++++++++++++------------ test/source_location_test3.cpp | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/doc/changes.adoc b/doc/changes.adoc index 303c291..3518c4a 100644 --- a/doc/changes.adoc +++ b/doc/changes.adoc @@ -1,5 +1,5 @@ //// -Copyright 2019 Peter Dimov +Copyright 2019, 2021 Peter Dimov Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt //// @@ -10,6 +10,10 @@ http://www.boost.org/LICENSE_1_0.txt :toc-title: :idprefix: +## Changes in 1.78.0 + +* Added `source_location::to_string`. + ## Changes in 1.73.0 * Added `source_location`. diff --git a/doc/index.adoc b/doc/index.adoc index 95d52c2..bf51cbd 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -30,7 +30,7 @@ include::changes.adoc[] This documentation is -* Copyright 2002, 2007, 2014, 2017, 2019, 2020 Peter Dimov +* Copyright 2002, 2007, 2014, 2017, 2019-2021 Peter Dimov * Copyright 2011 Beman Dawes * Copyright 2015 Ion Gaztañaga * Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0]. diff --git a/doc/source_location.adoc b/doc/source_location.adoc index d3436e8..d7c11fa 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -1,5 +1,5 @@ //// -Copyright 2019 Peter Dimov +Copyright 2019, 2021 Peter Dimov Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt //// @@ -28,19 +28,21 @@ namespace boost struct source_location { - constexpr source_location() noexcept; - constexpr source_location(char const* file, uint_least32_t line, - char const* function, uint_least32_t column = 0) noexcept; - - constexpr char const* file_name() const noexcept; - constexpr char const* function_name() const noexcept; - constexpr uint_least32_t line() const noexcept; - constexpr uint_least32_t column() const noexcept; + constexpr source_location() noexcept; + constexpr source_location(char const* file, uint_least32_t line, + char const* function, uint_least32_t column = 0) noexcept; + + constexpr char const* file_name() const noexcept; + constexpr char const* function_name() const noexcept; + constexpr uint_least32_t line() const noexcept; + constexpr uint_least32_t column() const noexcept; + + std::string to_string() const; }; template std::basic_ostream & - operator<<( std::basic_ostream & os, source_location const & loc ); + operator<<( std::basic_ostream & os, source_location const & loc ); } // namespace boost @@ -67,16 +69,26 @@ Effects: :: Constructs a `source_location` object for which `file_name()` returns `file`, `function_name()` returns `function`, `line()` returns the `line` argument and `column()` returns the `column` argument. +## to_string + +``` +std::string to_string() const; +``` + +Returns: :: + a string representation of `*this`. + ## operator<< ``` template std::basic_ostream & - operator<<( std::basic_ostream & os, source_location const & loc ); + operator<<( std::basic_ostream & os, source_location const & loc ); ``` -Effects: :: Outputs a string representation of `loc` to `os`. -Returns: :: `os`. +Effects: :: `os << loc.to_string()`. +Returns: :: + `os`. ## BOOST_CURRENT_LOCATION diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index f2247cc..3bccd81 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -1,4 +1,4 @@ -// Copyright 2020 Peter Dimov +// Copyright 2020, 2021 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt From f4d7aeb67473b712bab97ff3e66932a0a18cdf4f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 28 Oct 2021 23:08:08 +0300 Subject: [PATCH 013/110] Add msvc-14.3 to ci.yml --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8028406..3ac27f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,6 +155,10 @@ jobs: cxxstd: "14,17,latest" addrmd: 32,64 os: windows-2019 + - toolset: msvc-14.3 + cxxstd: "14,17,latest" + addrmd: 32,64 + os: windows-2022 - toolset: gcc cxxstd: "03,11,14,17,2a" addrmd: 64 From 5e71707fd73509d73094de4b9662fc9098cd6635 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 28 Oct 2021 23:09:09 +0300 Subject: [PATCH 014/110] Enable syntax highlighting --- doc/index.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/index.adoc b/doc/index.adoc index bf51cbd..7fed886 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -12,6 +12,8 @@ Peter Dimov :toc: left :idprefix: :docinfo: private-footer +:source-highlighter: rouge +:source-language: c++ The Boost.Assert library provides several configurable diagnostic macros similar in behavior and purpose to the standard macro `assert` from ``. From 63ff7896577113aa366b4f7cf3a1aa1ed9833ef7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 29 Oct 2021 04:47:57 +0300 Subject: [PATCH 015/110] Update static_assert, throw_exception in appveyor.yml --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c42111a..86a260c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,10 +44,12 @@ install: - cd boost-root - git submodule update --init tools/build - git submodule update --init tools/boost_install + - git submodule update --init tools/cmake + - git submodule update --init libs/headers - git submodule update --init libs/config - git submodule update --init libs/core - - git submodule update --init libs/headers - - git submodule update --init tools/cmake + - git submodule update --init libs/static_assert + - git submodule update --init libs/throw_exception - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\assert\ - cmd /c bootstrap - b2 -d0 headers From 65068b2b9adb23415f3b68de7a12f34e075c2101 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 7 Nov 2021 20:30:51 +0200 Subject: [PATCH 016/110] Add the error handling category to libraries.json --- meta/libraries.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/libraries.json b/meta/libraries.json index 8588d3d..a8ead08 100644 --- a/meta/libraries.json +++ b/meta/libraries.json @@ -9,7 +9,8 @@ ], "description": "Customizable assert macros.", "category": [ - "Correctness" + "Correctness", + "Error-handling" ], "cxxstd": "03" } From 0e99024312838352597aa949078473c1cf71b89c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 06:56:39 +0200 Subject: [PATCH 017/110] Change file_name() and function_name() for source_location() to return '' instead of '(unknown)' --- doc/changes.adoc | 5 +++++ doc/source_location.adoc | 3 +-- include/boost/assert/source_location.hpp | 2 +- test/source_location_test.cpp | 5 ++--- test/source_location_test2.cpp | 9 ++++----- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/changes.adoc b/doc/changes.adoc index 3518c4a..b850b83 100644 --- a/doc/changes.adoc +++ b/doc/changes.adoc @@ -10,6 +10,11 @@ http://www.boost.org/LICENSE_1_0.txt :toc-title: :idprefix: +## Changes in 1.79.0 + +* `source_location().file_name()` and `source_location().function_name()` + now return `""` instead of `"(unknown)"`. + ## Changes in 1.78.0 * Added `source_location::to_string`. diff --git a/doc/source_location.adoc b/doc/source_location.adoc index d7c11fa..3d00e2c 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -57,8 +57,7 @@ constexpr source_location() noexcept; ``` Effects: :: Constructs a `source_location` object for which `file_name()` -and `function_name()` return `"(unknown)"`, and `line()` and `column()` -return `0`. +and `function_name()` return `""`, and `line()` and `column()` return `0`. ``` constexpr source_location(char const* file, uint_least32_t line, diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 162d788..0977f67 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -28,7 +28,7 @@ struct source_location public: - BOOST_CONSTEXPR source_location() BOOST_NOEXCEPT: file_( "(unknown)" ), function_( "(unknown)" ), line_( 0 ), column_( 0 ) + BOOST_CONSTEXPR source_location() BOOST_NOEXCEPT: file_( "" ), function_( "" ), line_( 0 ), column_( 0 ) { } diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index f94e230..254c4cb 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -10,8 +10,8 @@ int main() { boost::source_location loc; - BOOST_TEST_CSTR_EQ( loc.file_name(), "(unknown)" ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "(unknown)" ); + BOOST_TEST_CSTR_EQ( loc.file_name(), "" ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "" ); BOOST_TEST_EQ( loc.line(), 0 ); BOOST_TEST_EQ( loc.column(), 0 ); } @@ -19,7 +19,6 @@ int main() { boost::source_location loc = BOOST_CURRENT_LOCATION; - BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); BOOST_TEST_CSTR_EQ( loc.function_name(), BOOST_CURRENT_FUNCTION ); BOOST_TEST_EQ( loc.line(), 20 ); diff --git a/test/source_location_test2.cpp b/test/source_location_test2.cpp index e21e3f6..071b732 100644 --- a/test/source_location_test2.cpp +++ b/test/source_location_test2.cpp @@ -12,8 +12,8 @@ int main() { boost::source_location loc; - BOOST_TEST_CSTR_EQ( loc.file_name(), "(unknown)" ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "(unknown)" ); + BOOST_TEST_CSTR_EQ( loc.file_name(), "" ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "" ); BOOST_TEST_EQ( loc.line(), 0 ); BOOST_TEST_EQ( loc.column(), 0 ); } @@ -21,9 +21,8 @@ int main() { boost::source_location loc = BOOST_CURRENT_LOCATION; - - BOOST_TEST_CSTR_EQ( loc.file_name(), "(unknown)" ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "(unknown)" ); + BOOST_TEST_CSTR_EQ( loc.file_name(), "" ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "" ); BOOST_TEST_EQ( loc.line(), 0 ); BOOST_TEST_EQ( loc.column(), 0 ); } From ce2133a17f774c5baee36086cdd754cd094e91af Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 07:02:25 +0200 Subject: [PATCH 018/110] sprintf line() and column() as unsigned long --- include/boost/assert/source_location.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 0977f67..2de4594 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -72,12 +72,12 @@ struct source_location char buffer[ 16 ]; - std::sprintf( buffer, ":%ld", static_cast( line() ) ); + std::sprintf( buffer, ":%lu", static_cast( line() ) ); r += buffer; if( column() ) { - std::sprintf( buffer, ":%ld", static_cast( column() ) ); + std::sprintf( buffer, ":%lu", static_cast( column() ) ); r += buffer; } From 25f0bab73331a8b2207388ad5a4a111a3174af77 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 07:10:59 +0200 Subject: [PATCH 019/110] Add a source_location constructor from std::source_location --- doc/changes.adoc | 1 + doc/source_location.adoc | 17 +++++++++++++---- include/boost/assert/source_location.hpp | 12 ++++++++++++ test/source_location_test.cpp | 14 ++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/doc/changes.adoc b/doc/changes.adoc index b850b83..618e508 100644 --- a/doc/changes.adoc +++ b/doc/changes.adoc @@ -14,6 +14,7 @@ http://www.boost.org/LICENSE_1_0.txt * `source_location().file_name()` and `source_location().function_name()` now return `""` instead of `"(unknown)"`. +* Added a `source_location` constructor from `std::source_location`. ## Changes in 1.78.0 diff --git a/doc/source_location.adoc b/doc/source_location.adoc index 3d00e2c..ff24d6c 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -29,8 +29,9 @@ namespace boost struct source_location { constexpr source_location() noexcept; - constexpr source_location(char const* file, uint_least32_t line, - char const* function, uint_least32_t column = 0) noexcept; + constexpr source_location( char const* file, uint_least32_t line, + char const* function, uint_least32_t column = 0 ) noexcept; + constexpr source_location( std::source_location const& loc ) noexcept; constexpr char const* file_name() const noexcept; constexpr char const* function_name() const noexcept; @@ -60,14 +61,22 @@ Effects: :: Constructs a `source_location` object for which `file_name()` and `function_name()` return `""`, and `line()` and `column()` return `0`. ``` -constexpr source_location(char const* file, uint_least32_t line, - char const* function, uint_least32_t column = 0) noexcept; +constexpr source_location( char const* file, uint_least32_t line, + char const* function, uint_least32_t column = 0 ) noexcept; ``` Effects: :: Constructs a `source_location` object for which `file_name()` returns `file`, `function_name()` returns `function`, `line()` returns the `line` argument and `column()` returns the `column` argument. +``` +constexpr source_location( std::source_location const& loc ) noexcept; +``` + +Effects: :: Constructs a `source_location` object for which `file_name()` +returns `loc.file_name()`, `function_name()` returns `loc.function_name()`, +`line()` returns `loc.line()` argument and `column()` returns `loc.column()`. + ## to_string ``` diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 2de4594..18db99a 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -14,6 +14,10 @@ #include #include +#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +# include +#endif + namespace boost { @@ -36,6 +40,14 @@ struct source_location { } +#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) + + BOOST_CONSTEXPR source_location( std::source_location const& loc ) BOOST_NOEXCEPT: file_( loc.file_name() ), function_( loc.function_name() ), line_( loc.line() ), column_( loc.column() ) + { + } + +#endif + BOOST_CONSTEXPR char const * file_name() const BOOST_NOEXCEPT { return file_; diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index 254c4cb..b05dbf6 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -25,5 +25,19 @@ int main() BOOST_TEST_EQ( loc.column(), 0 ); } +#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) + + { + std::source_location loc = std::source_location::current(); + boost::source_location loc2 = loc; + + BOOST_TEST_CSTR_EQ( loc2.file_name(), loc.file_name() ); + BOOST_TEST_CSTR_EQ( loc2.function_name(), loc.function_name() ); + BOOST_TEST_EQ( loc2.line(), loc.line() ); + BOOST_TEST_EQ( loc2.column(), loc.column() ); + } + +#endif + return boost::report_errors(); } From fde226c7f5d579474698444b1c497108044133bc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 09:31:27 +0200 Subject: [PATCH 020/110] Use __cpp_lib_source_location instead of BOOST_NO_CXX20_HDR_SOURCE_LOCATION --- include/boost/assert/source_location.hpp | 4 ++-- test/source_location_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 18db99a..9b46e05 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -14,7 +14,7 @@ #include #include -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L # include #endif @@ -40,7 +40,7 @@ struct source_location { } -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L BOOST_CONSTEXPR source_location( std::source_location const& loc ) BOOST_NOEXCEPT: file_( loc.file_name() ), function_( loc.function_name() ), line_( loc.line() ), column_( loc.column() ) { diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index b05dbf6..fc13802 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -25,7 +25,7 @@ int main() BOOST_TEST_EQ( loc.column(), 0 ); } -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L { std::source_location loc = std::source_location::current(); From 8bffbbe5b017140f5d22d23aea8e847aa9b614e4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 09:46:22 +0200 Subject: [PATCH 021/110] Fix typo --- doc/source_location.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source_location.adoc b/doc/source_location.adoc index ff24d6c..bed61cd 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -75,7 +75,7 @@ constexpr source_location( std::source_location const& loc ) noexcept; Effects: :: Constructs a `source_location` object for which `file_name()` returns `loc.file_name()`, `function_name()` returns `loc.function_name()`, -`line()` returns `loc.line()` argument and `column()` returns `loc.column()`. +`line()` returns `loc.line()` and `column()` returns `loc.column()`. ## to_string From 23e699b9a4c84d2e9c3ad10901fe92f84d3a8d09 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 20:28:59 +0200 Subject: [PATCH 022/110] Use std::source_location::current() in BOOST_CURRENT_LOCATION --- include/boost/assert/source_location.hpp | 4 +++ test/source_location_test.cpp | 7 +++- test/source_location_test3.cpp | 41 ++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 9b46e05..c556f93 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -118,6 +118,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location() +#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L + +# define BOOST_CURRENT_LOCATION ::boost::source_location(std::source_location::current()) + #elif defined(__clang_analyzer__) // Cast to char const* to placate clang-tidy diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index fc13802..1eaabf8 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -20,9 +20,14 @@ int main() boost::source_location loc = BOOST_CURRENT_LOCATION; BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST_CSTR_EQ( loc.function_name(), BOOST_CURRENT_FUNCTION ); BOOST_TEST_EQ( loc.line(), 20 ); + +#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + + BOOST_TEST_CSTR_EQ( loc.function_name(), BOOST_CURRENT_FUNCTION ); BOOST_TEST_EQ( loc.column(), 0 ); + +#endif } #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index 3bccd81..ae73dd7 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -23,12 +23,12 @@ int main() } { - boost::source_location loc = BOOST_CURRENT_LOCATION; + boost::source_location loc( __FILE__, __LINE__, BOOST_CURRENT_FUNCTION ); BOOST_TEST_EQ( loc.to_string(), std::string( __FILE__ ) + ":26 in function '" + BOOST_CURRENT_FUNCTION + "'" ); } { - boost::source_location loc = BOOST_CURRENT_LOCATION; + boost::source_location loc( __FILE__, __LINE__, BOOST_CURRENT_FUNCTION ); std::ostringstream os; os << loc; @@ -36,5 +36,42 @@ int main() BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":31 in function '" + BOOST_CURRENT_FUNCTION + "'" ); } + { + boost::source_location loc = BOOST_CURRENT_LOCATION; + + std::string prefix = std::string( __FILE__ ) + ":40"; + +#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + + BOOST_TEST_EQ( loc.to_string(), prefix + " in function '" + BOOST_CURRENT_FUNCTION + "'" ); + +#else + + // column and function vary when coming from std::source_location::current() + BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); + +#endif + } + + { + boost::source_location loc = BOOST_CURRENT_LOCATION; + + std::ostringstream os; + os << loc; + + std::string prefix = std::string( __FILE__ ) + ":57"; + +#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + + BOOST_TEST_EQ( os.str(), prefix + " in function '" + BOOST_CURRENT_FUNCTION + "'" ); + +#else + + // column and function vary when coming from std::source_location::current() + BOOST_TEST_EQ( os.str().substr( 0, prefix.size() ), prefix ); + +#endif + } + return boost::report_errors(); } From 844d8c224558966a745b20f4fbda28b64d243b5e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 21:19:43 +0200 Subject: [PATCH 023/110] Enable BOOST_CURRENT_LOCATION at top level and in default arguments --- include/boost/assert/source_location.hpp | 58 ++++++++++++++++------ test/Jamfile.v2 | 1 + test/source_location_test.cpp | 21 ++++++-- test/source_location_test3.cpp | 62 ++++++++++++++++-------- test/source_location_test4.cpp | 42 ++++++++++++++++ 5 files changed, 144 insertions(+), 40 deletions(-) create mode 100644 test/source_location_test4.cpp diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index c556f93..6bb1ad0 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -9,10 +9,12 @@ #include #include +#include #include #include #include #include +#include #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L # include @@ -75,7 +77,9 @@ struct source_location std::string to_string() const { - if( line() == 0 ) + unsigned long ln = line(); + + if( ln == 0 ) { return "(unknown source location)"; } @@ -84,18 +88,25 @@ struct source_location char buffer[ 16 ]; - std::sprintf( buffer, ":%lu", static_cast( line() ) ); + std::sprintf( buffer, ":%lu", ln ); r += buffer; - if( column() ) + unsigned long co = column(); + + if( co ) { - std::sprintf( buffer, ":%lu", static_cast( column() ) ); + std::sprintf( buffer, ":%lu", co ); r += buffer; } - r += " in function '"; - r += function_name(); - r += '\''; + char const* fn = function_name(); + + if( *fn != 0 ) + { + r += " in function '"; + r += fn; + r += '\''; + } return r; } @@ -112,25 +123,42 @@ template std::basic_ostream & operator<<( std::basic_ost return os; } +namespace detail +{ + +inline char const* srcloc_strip_top_level( char const* fn ) +{ + return std::strcmp( fn, "top level" ) == 0? "": fn; +} + +} // namespace detail + } // namespace boost #if defined( BOOST_DISABLE_CURRENT_LOCATION ) -# define BOOST_CURRENT_LOCATION ::boost::source_location() +# define BOOST_CURRENT_LOCATION ::boost::source_location() + +#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !BOOST_WORKAROUND(BOOST_MSVC, < 1931) + +# define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current()) + +#elif defined(BOOST_DISABLE_CURRENT_FUNCTION) || defined(__clang_analyzer__) // https://bugs.llvm.org/show_bug.cgi?id=28480 -#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, "") -# define BOOST_CURRENT_LOCATION ::boost::source_location(std::source_location::current()) +#elif defined(__GNUC__) -#elif defined(__clang_analyzer__) +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) -// Cast to char const* to placate clang-tidy -// https://bugs.llvm.org/show_bug.cgi?id=28480 -# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, static_cast(BOOST_CURRENT_FUNCTION)) +# if defined(__clang__) +//# pragma clang diagnostic ignored "-W" +# endif #else -# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION) +// __func__ macros aren't allowed outside functions, but BOOST_CURRENT_LOCATION is +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, "") #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index b7a9bfc..89d75bd 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -40,3 +40,4 @@ run current_function_test2.cpp ; run source_location_test.cpp ; run source_location_test2.cpp ; run source_location_test3.cpp ; +run source_location_test4.cpp ; diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index 1eaabf8..265984b 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -17,17 +17,28 @@ int main() } { - boost::source_location loc = BOOST_CURRENT_LOCATION; + boost::source_location loc( __FILE__, __LINE__, "main" ); BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); BOOST_TEST_EQ( loc.line(), 20 ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "main" ); + BOOST_TEST_EQ( loc.column(), 0 ); + } -#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + { + boost::source_location loc( "file", 1, "main", 2 ); - BOOST_TEST_CSTR_EQ( loc.function_name(), BOOST_CURRENT_FUNCTION ); - BOOST_TEST_EQ( loc.column(), 0 ); + BOOST_TEST_CSTR_EQ( loc.file_name(), "file" ); + BOOST_TEST_EQ( loc.line(), 1 ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "main" ); + BOOST_TEST_EQ( loc.column(), 2 ); + } -#endif + { + boost::source_location loc = BOOST_CURRENT_LOCATION; + + BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); + BOOST_TEST_EQ( loc.line(), 38 ); } #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index ae73dd7..4e0bb86 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -23,54 +23,76 @@ int main() } { - boost::source_location loc( __FILE__, __LINE__, BOOST_CURRENT_FUNCTION ); - BOOST_TEST_EQ( loc.to_string(), std::string( __FILE__ ) + ":26 in function '" + BOOST_CURRENT_FUNCTION + "'" ); + boost::source_location loc( "file", 5, "" ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:5" ) ); } { - boost::source_location loc( __FILE__, __LINE__, BOOST_CURRENT_FUNCTION ); + boost::source_location loc( "file", 5, "" ); std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":31 in function '" + BOOST_CURRENT_FUNCTION + "'" ); + BOOST_TEST_EQ( os.str(), std::string( "file:5" ) ); } { - boost::source_location loc = BOOST_CURRENT_LOCATION; + boost::source_location loc( "file", 7, "main" ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:7 in function 'main'" ) ); + } - std::string prefix = std::string( __FILE__ ) + ":40"; + { + boost::source_location loc( "file", 7, "main" ); -#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + std::ostringstream os; + os << loc; + + BOOST_TEST_EQ( os.str(), std::string( "file:7 in function 'main'" ) ); + } - BOOST_TEST_EQ( loc.to_string(), prefix + " in function '" + BOOST_CURRENT_FUNCTION + "'" ); + { + boost::source_location loc( "file", 11, "main", 13 ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:11:13 in function 'main'" ) ); + } -#else + { + boost::source_location loc( "file", 11, "main", 13 ); - // column and function vary when coming from std::source_location::current() - BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); + std::ostringstream os; + os << loc; -#endif + BOOST_TEST_EQ( os.str(), std::string( "file:11:13 in function 'main'" ) ); } { - boost::source_location loc = BOOST_CURRENT_LOCATION; + boost::source_location loc( "file", 17, "", 19 ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:17:19" ) ); + } + + { + boost::source_location loc( "file", 17, "", 19 ); std::ostringstream os; os << loc; - std::string prefix = std::string( __FILE__ ) + ":57"; + BOOST_TEST_EQ( os.str(), std::string( "file:17:19" ) ); + } + + { + boost::source_location loc = BOOST_CURRENT_LOCATION; -#if !( defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L ) + std::string prefix = std::string( __FILE__ ) + ":82"; + BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); + } - BOOST_TEST_EQ( os.str(), prefix + " in function '" + BOOST_CURRENT_FUNCTION + "'" ); + { + boost::source_location loc = BOOST_CURRENT_LOCATION; -#else + std::ostringstream os; + os << loc; - // column and function vary when coming from std::source_location::current() + std::string prefix = std::string( __FILE__ ) + ":89"; BOOST_TEST_EQ( os.str().substr( 0, prefix.size() ), prefix ); - -#endif } return boost::report_errors(); diff --git a/test/source_location_test4.cpp b/test/source_location_test4.cpp new file mode 100644 index 0000000..35c78b5 --- /dev/null +++ b/test/source_location_test4.cpp @@ -0,0 +1,42 @@ +// Copyright 2022 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +boost::source_location s_loc = BOOST_CURRENT_LOCATION; + +boost::source_location f( boost::source_location const& loc = BOOST_CURRENT_LOCATION ) +{ + return loc; +} + +int main() +{ + { + BOOST_TEST_CSTR_EQ( s_loc.file_name(), __FILE__ ); + BOOST_TEST_EQ( s_loc.line(), 8 ); + BOOST_TEST_CSTR_EQ( s_loc.function_name(), "" ); + } + + { + boost::source_location loc = f(); + +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !BOOST_WORKAROUND(BOOST_MSVC, < 1931) + + BOOST_TEST_CSTR_EQ( loc.file_name(), std::source_location::current().file_name() ); + BOOST_TEST_CSTR_EQ( loc.function_name(), std::source_location::current().function_name() ); + BOOST_TEST_EQ( loc.line(), 24 ); + +#else + + BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); + BOOST_TEST_EQ( loc.line(), 10 ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "" ); + +#endif + } + + return boost::report_errors(); +} From 1a80da62984d15040760456c4d56aa89a431e174 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 21:22:45 +0200 Subject: [PATCH 024/110] Enable __PRETTY_FUNCTION__ on Clang, but disable top-level warning --- include/boost/assert/source_location.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 6bb1ad0..abc029a 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -147,12 +147,12 @@ inline char const* srcloc_strip_top_level( char const* fn ) # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, "") -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__clang__) # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) # if defined(__clang__) -//# pragma clang diagnostic ignored "-W" +# pragma clang diagnostic ignored "-Wpredefined-identifier-outside-function" # endif #else From 762a98d2276ac7b30caad62e6c65b041700555cb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 02:07:36 +0200 Subject: [PATCH 025/110] Use __builtin_FILE et al in BOOST_CURRENT_LOCATION --- include/boost/assert/source_location.hpp | 30 ++++++++---------------- test/source_location_test4.cpp | 13 +--------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index abc029a..fabce91 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -123,37 +123,27 @@ template std::basic_ostream & operator<<( std::basic_ost return os; } -namespace detail -{ - -inline char const* srcloc_strip_top_level( char const* fn ) -{ - return std::strcmp( fn, "top level" ) == 0? "": fn; -} - -} // namespace detail - } // namespace boost -#if defined( BOOST_DISABLE_CURRENT_LOCATION ) +#if defined(BOOST_DISABLE_CURRENT_LOCATION) # define BOOST_CURRENT_LOCATION ::boost::source_location() -#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !BOOST_WORKAROUND(BOOST_MSVC, < 1931) +#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926 -# define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current()) +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) -#elif defined(BOOST_DISABLE_CURRENT_FUNCTION) || defined(__clang_analyzer__) // https://bugs.llvm.org/show_bug.cgi?id=28480 +#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L -# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, "") +# define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current()) + +#elif defined(BOOST_CLANG) && BOOST_CLANG_VERSION >= 90000 -#elif defined(__GNUC__) || defined(__clang__) +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) -# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) +#elif defined(BOOST_GCC) && BOOST_GCC >= 40800 -# if defined(__clang__) -# pragma clang diagnostic ignored "-Wpredefined-identifier-outside-function" -# endif +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION()) #else diff --git a/test/source_location_test4.cpp b/test/source_location_test4.cpp index 35c78b5..dd053fe 100644 --- a/test/source_location_test4.cpp +++ b/test/source_location_test4.cpp @@ -23,19 +23,8 @@ int main() { boost::source_location loc = f(); -#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !BOOST_WORKAROUND(BOOST_MSVC, < 1931) - - BOOST_TEST_CSTR_EQ( loc.file_name(), std::source_location::current().file_name() ); - BOOST_TEST_CSTR_EQ( loc.function_name(), std::source_location::current().function_name() ); - BOOST_TEST_EQ( loc.line(), 24 ); - -#else - BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( loc.line(), 10 ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "" ); - -#endif + BOOST_TEST( loc.line() == 10 || loc.line() == 24 ); } return boost::report_errors(); From e4c8016b1108df1e2b2192c27960d1a9b8a12cc1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 02:29:59 +0200 Subject: [PATCH 026/110] Address gcc-8 and below failures --- test/source_location_test4.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/source_location_test4.cpp b/test/source_location_test4.cpp index dd053fe..bfc06d6 100644 --- a/test/source_location_test4.cpp +++ b/test/source_location_test4.cpp @@ -4,6 +4,7 @@ #include #include +#include boost::source_location s_loc = BOOST_CURRENT_LOCATION; @@ -16,15 +17,20 @@ int main() { { BOOST_TEST_CSTR_EQ( s_loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( s_loc.line(), 8 ); + BOOST_TEST_EQ( s_loc.line(), 9 ); + +#if defined(BOOST_GCC) && BOOST_GCC < 90000 + // '__static_initialization_and_destruction_0' +#else BOOST_TEST_CSTR_EQ( s_loc.function_name(), "" ); +#endif } { boost::source_location loc = f(); BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST( loc.line() == 10 || loc.line() == 24 ); + BOOST_TEST( loc.line() == 11 || loc.line() == 30 ); } return boost::report_errors(); From 93453bba64f97f5eee87cea39a3f98eefb23b917 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 04:03:43 +0200 Subject: [PATCH 027/110] Update tests --- test/source_location_test.cpp | 8 +++--- test/source_location_test3.cpp | 47 ++++++++-------------------------- 2 files changed, 15 insertions(+), 40 deletions(-) diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index 265984b..9373fa4 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -17,20 +17,20 @@ int main() } { - boost::source_location loc( __FILE__, __LINE__, "main" ); + boost::source_location loc( __FILE__, __LINE__, "main()" ); BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); BOOST_TEST_EQ( loc.line(), 20 ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "main" ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "main()" ); BOOST_TEST_EQ( loc.column(), 0 ); } { - boost::source_location loc( "file", 1, "main", 2 ); + boost::source_location loc( "file", 1, "main()", 2 ); BOOST_TEST_CSTR_EQ( loc.file_name(), "file" ); BOOST_TEST_EQ( loc.line(), 1 ); - BOOST_TEST_CSTR_EQ( loc.function_name(), "main" ); + BOOST_TEST_CSTR_EQ( loc.function_name(), "main()" ); BOOST_TEST_EQ( loc.column(), 2 ); } diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index 4e0bb86..6d01a4b 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -11,88 +11,63 @@ int main() { boost::source_location loc; BOOST_TEST_EQ( loc.to_string(), std::string( "(unknown source location)" ) ); - } - - { - boost::source_location loc; std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( "(unknown source location)" ) ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } { boost::source_location loc( "file", 5, "" ); BOOST_TEST_EQ( loc.to_string(), std::string( "file:5" ) ); - } - - { - boost::source_location loc( "file", 5, "" ); std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( "file:5" ) ); - } - - { - boost::source_location loc( "file", 7, "main" ); - BOOST_TEST_EQ( loc.to_string(), std::string( "file:7 in function 'main'" ) ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } { - boost::source_location loc( "file", 7, "main" ); + boost::source_location loc( "file", 7, "main()" ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:7 in function 'main()'" ) ); std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( "file:7 in function 'main'" ) ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } { - boost::source_location loc( "file", 11, "main", 13 ); - BOOST_TEST_EQ( loc.to_string(), std::string( "file:11:13 in function 'main'" ) ); - } - - { - boost::source_location loc( "file", 11, "main", 13 ); + boost::source_location loc( "file", 11, "main()", 13 ); + BOOST_TEST_EQ( loc.to_string(), std::string( "file:11:13 in function 'main()'" ) ); std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( "file:11:13 in function 'main'" ) ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } { boost::source_location loc( "file", 17, "", 19 ); BOOST_TEST_EQ( loc.to_string(), std::string( "file:17:19" ) ); - } - - { - boost::source_location loc( "file", 17, "", 19 ); std::ostringstream os; os << loc; - BOOST_TEST_EQ( os.str(), std::string( "file:17:19" ) ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } { boost::source_location loc = BOOST_CURRENT_LOCATION; - std::string prefix = std::string( __FILE__ ) + ":82"; + std::string prefix = std::string( __FILE__ ) + ":62"; BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); - } - - { - boost::source_location loc = BOOST_CURRENT_LOCATION; std::ostringstream os; os << loc; - std::string prefix = std::string( __FILE__ ) + ":89"; - BOOST_TEST_EQ( os.str().substr( 0, prefix.size() ), prefix ); + BOOST_TEST_EQ( os.str(), loc.to_string() ); } return boost::report_errors(); From 47a44c14c350a75e308deb3a679ffed386e7b500 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 05:01:45 +0200 Subject: [PATCH 028/110] Update documentation --- doc/changes.adoc | 3 ++ doc/index.adoc | 2 +- doc/source_location.adoc | 91 ++++++++++++++++++++++++++++++++++------ 3 files changed, 83 insertions(+), 13 deletions(-) diff --git a/doc/changes.adoc b/doc/changes.adoc index 618e508..782c37b 100644 --- a/doc/changes.adoc +++ b/doc/changes.adoc @@ -15,6 +15,9 @@ http://www.boost.org/LICENSE_1_0.txt * `source_location().file_name()` and `source_location().function_name()` now return `""` instead of `"(unknown)"`. * Added a `source_location` constructor from `std::source_location`. +* Changed `BOOST_CURRENT_LOCATION` to more closely match the behavior of + `std::source_location::current()`, such as being usable at top level or + as a default function argument. ## Changes in 1.78.0 diff --git a/doc/index.adoc b/doc/index.adoc index 7fed886..9873bdb 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -32,7 +32,7 @@ include::changes.adoc[] This documentation is -* Copyright 2002, 2007, 2014, 2017, 2019-2021 Peter Dimov +* Copyright 2002, 2007, 2014, 2017, 2019-2022 Peter Dimov * Copyright 2011 Beman Dawes * Copyright 2015 Ion Gaztañaga * Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0]. diff --git a/doc/source_location.adoc b/doc/source_location.adoc index bed61cd..8d0adc9 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -1,5 +1,5 @@ //// -Copyright 2019, 2021 Peter Dimov +Copyright 2019, 2021, 2022 Peter Dimov Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt //// @@ -18,7 +18,74 @@ and column information. It's similar to `std::source_location` from {cpp}20, but only requires {cpp}03. The macro `BOOST_CURRENT_LOCATION` creates a `source_location` object -containing information about the current source location. +containing information about the current source location. It can be used +roughly in the same way `std::source_location::current()` can be used, +such as in the declaration of a function default argument: + +``` +#include +#include + +void f( boost::source_location const& loc = BOOST_CURRENT_LOCATION ) +{ + std::cout << "f() called from: " << loc << std::endl; +} + +int main() +{ + f(); +} +``` + +The output of this example varies by compiler and C++ standard level, but +it's generally one of + +```none +f() called from: example.cpp:11:6 in function 'int main()' +``` +```none +f() called from: example.cpp:11:5 in function 'main' +``` +```none +f() called from: example.cpp:11 in function 'main' +``` +```none +f() called from: example.cpp:11 in function 'main' +``` +```none +f() called from: example.cpp:4 +``` + +This is useful if, for example, you want to declare a function that throws +an exception, such that the source location of the caller is attached to +the thrown exception: + +``` +BOOST_NORETURN BOOST_NOINLINE void throw_invalid_argument( + char const* message, + boost::source_location const& loc = BOOST_CURRENT_LOCATION ) +{ + boost::throw_exception( std::invalid_argument( message ), loc ); +} +``` + +Now you could use this helper function in, say, the implementation of +`at` to signal an index that is out of range: + +``` +T& my_class::at( size_t i ) +{ + if( i >= size() ) throw_invalid_argument( "index out of range" ); + return data()[ i ]; +} +``` + +This would attach the source location of the line in `at` that calls +`throw_invalid_argument` to the thrown exception. + +Note that if instead you use `BOOST_THROW_EXCEPTION` in +`throw_invalid_argument`, the location will be that of +`throw_invalid_argument` and not of its caller. ## Synopsis @@ -47,8 +114,7 @@ template } // namespace boost -#define BOOST_CURRENT_LOCATION \ - ::boost::source_location(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION) +#define BOOST_CURRENT_LOCATION /* see below */ ``` ## source_location @@ -100,19 +166,20 @@ Returns: :: ## BOOST_CURRENT_LOCATION -When `BOOST_DISABLE_CURRENT_LOCATION` is not defined, the definition of +When `BOOST_DISABLE_CURRENT_LOCATION` is defined, the definition of `BOOST_CURRENT_LOCATION` is: -``` -#define BOOST_CURRENT_LOCATION \ - ::boost::source_location(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION) -``` - -Otherwise, `BOOST_CURRENT_LOCATION` is defined as: - ``` #define BOOST_CURRENT_LOCATION ::boost::source_location() ``` This allows producing executables that contain no identifying information, for security reasons. + +Otherwise, `BOOST_CURRENT_LOCATION` is defined as the approximate equivalent +of + +``` +#define BOOST_CURRENT_LOCATION \ + ::boost::source_location(::std::source_location::current()) +``` From cc990d571e762b82e1ebebad82985ba2000060af Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 06:08:20 +0200 Subject: [PATCH 029/110] Update BOOST_CURRENT_FUNCTION documentation; closes #23 --- doc/current_function.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/current_function.adoc b/doc/current_function.adoc index 21453a2..b65f6d6 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -18,9 +18,10 @@ http://www.boost.org/LICENSE_1_0.txt The header `` defines a single macro, `BOOST_CURRENT_FUNCTION`, similar to the C99 predefined identifier `\\__func__`. -`BOOST_CURRENT_FUNCTION` expands to a string literal containing -the (fully qualified, if possible) name of the enclosing function. If there is -no enclosing function, the behavior is unspecified. +`BOOST_CURRENT_FUNCTION` expands to either a string literal, or the name of a +character array local to the current function, containing the (fully qualified, +if possible) name of the enclosing function. If there is no enclosing function, +the behavior varies by compiler, but is usually a compile error. Some compilers do not provide a way to obtain the name of the current enclosing function. On such compilers, or when the macro `BOOST_DISABLE_CURRENT_FUNCTION` From 7045cc185aed0884bf73f86ae785a8c646c50270 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 22:30:04 +0200 Subject: [PATCH 030/110] Add a test for BOOST_STATIC_CONSTEXPR source_location --- test/source_location_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index 9373fa4..dc087bb 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -41,6 +41,13 @@ int main() BOOST_TEST_EQ( loc.line(), 38 ); } + { + BOOST_STATIC_CONSTEXPR boost::source_location loc = BOOST_CURRENT_LOCATION; + + BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); + BOOST_TEST_EQ( loc.line(), 45 ); + } + #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L { From d6e87b8049c95b3bc12749ae045f32f852ea1fb1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 22:48:27 +0200 Subject: [PATCH 031/110] Update BOOST_CURRENT_LOCATION to be constexpr --- include/boost/assert/source_location.hpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index fabce91..f32e548 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -123,6 +123,16 @@ template std::basic_ostream & operator<<( std::basic_ost return os; } +namespace detail +{ + +BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn ) +{ + return std::strcmp( fn, "top level" ) == 0? "": fn; +} + +} // namespace detail + } // namespace boost #if defined(BOOST_DISABLE_CURRENT_LOCATION) @@ -131,6 +141,8 @@ template std::basic_ostream & operator<<( std::basic_ost #elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926 +// std::source_location::current() is available in -std:c++20, but fails with consteval errors before 19.31, and doesn't produce +// the correct result under 19.31, so prefer the built-ins # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) #elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L @@ -141,10 +153,16 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) -#elif defined(BOOST_GCC) && BOOST_GCC >= 40800 +#elif defined(BOOST_GCC) && BOOST_GCC >= 70000 +// The built-ins are available in 4.8+, but are not constant expressions until 7 # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION()) +#elif defined(BOOST_GCC) + +// __PRETTY_FUNCTION__ is allowed outside functions under GCC +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) + #else // __func__ macros aren't allowed outside functions, but BOOST_CURRENT_LOCATION is From ea2eb5cc6c2c7edec2199c1cae7156c84568552f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 22:53:17 +0200 Subject: [PATCH 032/110] Update source_location_test4.cpp --- test/source_location_test4.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/source_location_test4.cpp b/test/source_location_test4.cpp index bfc06d6..420612e 100644 --- a/test/source_location_test4.cpp +++ b/test/source_location_test4.cpp @@ -8,6 +8,8 @@ boost::source_location s_loc = BOOST_CURRENT_LOCATION; +BOOST_STATIC_CONSTEXPR boost::source_location c_loc = BOOST_CURRENT_LOCATION; + boost::source_location f( boost::source_location const& loc = BOOST_CURRENT_LOCATION ) { return loc; @@ -26,11 +28,16 @@ int main() #endif } + { + BOOST_TEST_CSTR_EQ( c_loc.file_name(), __FILE__ ); + BOOST_TEST_EQ( c_loc.line(), 11 ); + } + { boost::source_location loc = f(); BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST( loc.line() == 11 || loc.line() == 30 ); + BOOST_TEST( loc.line() == 13 || loc.line() == 37 ); } return boost::report_errors(); From 7b14d83548d843b236ba31b75ce6e1a72924e5d5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 4 Feb 2022 22:55:13 +0200 Subject: [PATCH 033/110] Hide the definition of srcloc_strip_top_level from non-GCC compilers, specifically Clang --- include/boost/assert/source_location.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index f32e548..31a2107 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -123,6 +123,8 @@ template std::basic_ostream & operator<<( std::basic_ost return os; } +#if defined(BOOST_GCC) + namespace detail { @@ -133,6 +135,8 @@ BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn ) } // namespace detail +#endif // #if defined(BOOST_GCC) + } // namespace boost #if defined(BOOST_DISABLE_CURRENT_LOCATION) From 8cb06e5d821d6a44357dc06883485c17954b2493 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Feb 2022 00:06:29 +0200 Subject: [PATCH 034/110] Remove srcloc_strip_top_level, because the contents of __PRETTY_FUNCTION__ aren't constant before GCC 9 and strcmp fails --- include/boost/assert/source_location.hpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 31a2107..1c539bb 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -123,20 +123,6 @@ template std::basic_ostream & operator<<( std::basic_ost return os; } -#if defined(BOOST_GCC) - -namespace detail -{ - -BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn ) -{ - return std::strcmp( fn, "top level" ) == 0? "": fn; -} - -} // namespace detail - -#endif // #if defined(BOOST_GCC) - } // namespace boost #if defined(BOOST_DISABLE_CURRENT_LOCATION) @@ -165,7 +151,7 @@ BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn ) #elif defined(BOOST_GCC) // __PRETTY_FUNCTION__ is allowed outside functions under GCC -# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, __PRETTY_FUNCTION__) #else From f1310799aa65be8e799b21f1843fe2328cc634ee Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Feb 2022 01:03:45 +0200 Subject: [PATCH 035/110] Update ci.yml --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ac27f6..6e88a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,15 +147,23 @@ jobs: fail-fast: false matrix: include: + - toolset: msvc-14.0 + cxxstd: "14" + addrmd: 32,64 + os: windows-2019 - toolset: msvc-14.1 cxxstd: "14,17,latest" addrmd: 32,64 os: windows-2016 - toolset: msvc-14.2 - cxxstd: "14,17,latest" + cxxstd: "14,17,20,latest" addrmd: 32,64 os: windows-2019 - toolset: msvc-14.3 + cxxstd: "14,17,20,latest" + addrmd: 32,64 + os: windows-2022 + - toolset: clang-win cxxstd: "14,17,latest" addrmd: 32,64 os: windows-2022 @@ -195,7 +203,7 @@ jobs: shell: cmd run: | cd ../boost-root - b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release + b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker posix-cmake-subdir: strategy: From ab39bb78a6b551635eb0cc0a18ccbef61ce17d10 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Feb 2022 08:03:55 +0200 Subject: [PATCH 036/110] Add source_location_test5.cpp --- test/Jamfile.v2 | 1 + test/source_location_test5.cpp | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 test/source_location_test5.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 89d75bd..c869ff9 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -41,3 +41,4 @@ run source_location_test.cpp ; run source_location_test2.cpp ; run source_location_test3.cpp ; run source_location_test4.cpp ; +run source_location_test5.cpp ; diff --git a/test/source_location_test5.cpp b/test/source_location_test5.cpp new file mode 100644 index 0000000..ef8a0dc --- /dev/null +++ b/test/source_location_test5.cpp @@ -0,0 +1,44 @@ +// Copyright 2022 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +// Reduced from a boost::system::result test; codegen bug +// in GCC < 5 which is somehow triggered by __PRETTY_FUNCTION__ +// and throwing an exception + +#include +#include +#include + +template class result +{ +private: + + bool has_value_; + T value_; + +public: + + result(): has_value_( false ), value_() + { + } + + T value( boost::source_location const& /*loc*/ = BOOST_CURRENT_LOCATION ) const + { + if( has_value_ ) + { + return value_; + } + else + { + throw std::exception(); + } + } +}; + +int main() +{ + result r; + BOOST_TEST_THROWS( r.value(), std::exception ); + return boost::report_errors(); +} From 31b2f52083c2baad93a3ce2e12cf84355c1eabae Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Feb 2022 08:11:07 +0200 Subject: [PATCH 037/110] Do not use __PRETTY_FUNCTION__ on GCC 4.x due to codegen bugs --- include/boost/assert/source_location.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 1c539bb..dd1cfd7 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -148,9 +148,9 @@ template std::basic_ostream & operator<<( std::basic_ost // The built-ins are available in 4.8+, but are not constant expressions until 7 # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION()) -#elif defined(BOOST_GCC) +#elif defined(BOOST_GCC) && BOOST_GCC >= 50000 -// __PRETTY_FUNCTION__ is allowed outside functions under GCC +// __PRETTY_FUNCTION__ is allowed outside functions under GCC, but 4.x suffers from codegen bugs # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, __PRETTY_FUNCTION__) #else From 3e091f3dd7c61fd24ba800614fe8f4083c1883b0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Feb 2022 21:56:25 +0200 Subject: [PATCH 038/110] Add Drone files --- .drone.jsonnet | 253 +++++++++++++++++++++++++++++++++++++++++++++++ .drone/drone.bat | 23 +++++ .drone/drone.sh | 24 +++++ 3 files changed, 300 insertions(+) create mode 100644 .drone.jsonnet create mode 100644 .drone/drone.bat create mode 100644 .drone/drone.sh diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..6e1cb69 --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,253 @@ +# Copyright 2022 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +local library = "assert"; + +local triggers = +{ + branch: [ "master", "develop", "feature/*" ] +}; + +local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' }; +local asan = { ASAN: '1' }; + +local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "linux", + arch: arch + }, + steps: + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'set -e', + 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', + ] + + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + + [ + 'export LIBRARY=' + library, + './.drone/drone.sh', + ] + } + ] +}; + +local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "exec", + trigger: triggers, + platform: { + "os": "darwin", + "arch": arch + }, + node: { + "os": osx_version + }, + steps: [ + { + name: "everything", + environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" }, + commands: + [ + 'export LIBRARY=' + library, + './.drone/drone.sh', + ] + } + ] +}; + +local windows_pipeline(name, image, environment, arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "windows", + arch: arch + }, + "steps": + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'cmd /C .drone\\\\drone.bat ' + library, + ] + } + ] +}; + +[ + linux_pipeline( + "Linux 14.04 GCC 4.4", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' }, + "g++-4.4", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.6", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x' }, + "g++-4.6", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.7", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x' }, + "g++-4.7", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.8*", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11' }, + ), + + linux_pipeline( + "Linux 14.04 GCC 4.9", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11' }, + "g++-4.9", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 16.04 GCC 5*", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14' }, + ), + + linux_pipeline( + "Linux 18.04 GCC 6", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14' }, + "g++-6", + ), + + linux_pipeline( + "Linux 18.04 GCC 7* 32/64", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 18.04 GCC 8", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17' }, + "g++-8", + ), + + linux_pipeline( + "Linux 20.04 GCC 9* 32", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32' }, + ), + + linux_pipeline( + "Linux 20.04 GCC 9* 64", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '64' }, + ), + + linux_pipeline( + "Linux 20.04 GCC 9 ARM64 32/64", + "cppalliance/droneubuntu2004:multiarch", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + arch="arm64", + ), + + linux_pipeline( + "Linux 20.04 GCC 10 32 ASAN", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32' } + asan, + "g++-10-multilib", + ), + + linux_pipeline( + "Linux 20.04 GCC 10 64 ASAN", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '64' } + asan, + "g++-10-multilib", + ), + + linux_pipeline( + "Linux 20.04 Clang 13", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' }, + "clang-13", + ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"], + ), + + linux_pipeline( + "Linux 20.04 Clang 14 UBSAN", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + ubsan, + "clang-14", + ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"], + ), + + linux_pipeline( + "Linux 20.04 Clang 14 ASAN", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + asan, + "clang-14", + ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"], + ), + + macos_pipeline( + "MacOS 10.15 Xcode 12.2 UBSAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan, + ), + + macos_pipeline( + "MacOS 10.15 Xcode 12.2 ASAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + asan, + ), + + windows_pipeline( + "Windows VS2015 msvc-14.0", + "cppalliance/dronevs2015", + { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' }, + ), + + windows_pipeline( + "Windows VS2017 msvc-14.1", + "cppalliance/dronevs2017", + { TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' }, + ), + + windows_pipeline( + "Windows VS2019 msvc-14.2", + "cppalliance/dronevs2019", + { TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' }, + ), + + windows_pipeline( + "Windows VS2022 msvc-14.3", + "cppalliance/dronevs2022:1", + { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, + ), +] diff --git a/.drone/drone.bat b/.drone/drone.bat new file mode 100644 index 0000000..66aaf78 --- /dev/null +++ b/.drone/drone.bat @@ -0,0 +1,23 @@ +@REM Copyright 2022 Peter Dimov +@REM Distributed under the Boost Software License, Version 1.0. +@REM https://www.boost.org/LICENSE_1_0.txt + +@ECHO ON + +set LIBRARY=%1 +set DRONE_BUILD_DIR=%CD% + +set BOOST_BRANCH=develop +if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master +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 +xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\ +python tools/boostdep/depinst/depinst.py %LIBRARY% +cmd /c bootstrap +b2 -d0 headers + +if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% +if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% +b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100644 index 0000000..7172f7f --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright 2022 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +set -ex + +DRONE_BUILD_DIR=$(pwd) + +BOOST_BRANCH=develop +if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi + +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 $DRONE_BUILD_DIR/* libs/$LIBRARY +python tools/boostdep/depinst/depinst.py $LIBRARY +./bootstrap.sh +./b2 -d0 headers + +echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam +./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS} From df6e3962d05620accdd1cbe66c5252934c118fd6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Feb 2022 21:59:42 +0200 Subject: [PATCH 039/110] Add +x to drone.sh --- .drone/drone.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .drone/drone.sh diff --git a/.drone/drone.sh b/.drone/drone.sh old mode 100644 new mode 100755 From 74a4141253b49eeea4a5d0e96d349e0fd478d71a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Feb 2022 22:06:58 +0200 Subject: [PATCH 040/110] Update .drone.jsonnet --- .drone.jsonnet | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index 6e1cb69..ded860a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -193,6 +193,34 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-10-multilib", ), + linux_pipeline( + "Linux 16.04 Clang 3.5", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11,14' }, + "clang-3.5", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.6", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' }, + "clang-3.6", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.7", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' }, + "clang-3.7", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.8", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' }, + "clang-3.8", + ), + linux_pipeline( "Linux 20.04 Clang 13", "cppalliance/droneubuntu2004:1", From f795ba53faa98e3b031b87b39e19fc3a27730a83 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 9 Feb 2022 19:58:57 +0200 Subject: [PATCH 041/110] Update assert.adoc --- doc/assert.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/assert.adoc b/doc/assert.adoc index 3926224..4628e07 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -32,7 +32,7 @@ code. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_ASSERT(expr)` expands to + -``` +```none (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` @@ -75,7 +75,7 @@ the macro `NDEBUG` is defined. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_ASSERT_MSG(expr,msg)` expands to + -``` +```none (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` From f1a6f9ffd1a0161fc18fad36829033c570cf5ac3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 9 Feb 2022 19:59:48 +0200 Subject: [PATCH 042/110] Update source_location.adoc --- doc/source_location.adoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/source_location.adoc b/doc/source_location.adoc index 8d0adc9..6e4cee3 100644 --- a/doc/source_location.adoc +++ b/doc/source_location.adoc @@ -50,9 +50,6 @@ f() called from: example.cpp:11:5 in function 'main' f() called from: example.cpp:11 in function 'main' ``` ```none -f() called from: example.cpp:11 in function 'main' -``` -```none f() called from: example.cpp:4 ``` From a7af7efe51d1380854fb95a10066d73942181a6e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 5 May 2022 03:25:16 +0300 Subject: [PATCH 043/110] Add operator==, operator!= to source_location --- include/boost/assert/source_location.hpp | 9 +++++++++ test/Jamfile.v2 | 1 + test/source_location_test6.cpp | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 test/source_location_test6.cpp diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index dd1cfd7..9ab5c29 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -115,6 +115,15 @@ struct source_location # pragma warning( pop ) #endif + inline friend bool operator==( source_location const& s1, source_location const& s2 ) BOOST_NOEXCEPT + { + return std::strcmp( s1.file_, s2.file_ ) == 0 && std::strcmp( s1.function_, s2.function_ ) == 0 && s1.line_ == s2.line_ && s1.column_ == s2.column_; + } + + inline friend bool operator!=( source_location const& s1, source_location const& s2 ) BOOST_NOEXCEPT + { + return !( s1 == s2 ); + } }; template std::basic_ostream & operator<<( std::basic_ostream & os, source_location const & loc ) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c869ff9..ffe840e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -42,3 +42,4 @@ run source_location_test2.cpp ; run source_location_test3.cpp ; run source_location_test4.cpp ; run source_location_test5.cpp ; +run source_location_test6.cpp ; diff --git a/test/source_location_test6.cpp b/test/source_location_test6.cpp new file mode 100644 index 0000000..3153597 --- /dev/null +++ b/test/source_location_test6.cpp @@ -0,0 +1,23 @@ +// Copyright 2019 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +int main() +{ + { + boost::source_location loc, loc2; + + BOOST_TEST_EQ( loc, loc2 ); + + boost::source_location loc3 = BOOST_CURRENT_LOCATION; + boost::source_location loc4( loc3 ); + + BOOST_TEST_EQ( loc3, loc4 ); + BOOST_TEST_NE( loc3, loc ); + } + + return boost::report_errors(); +} From 78f28be697b0bd11fe11dc5e75b6d0ec66323aff Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 5 May 2022 04:03:24 +0300 Subject: [PATCH 044/110] Remove msvc-14.1 from ci.yml --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e88a9d..34f8621 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,10 +151,6 @@ jobs: cxxstd: "14" addrmd: 32,64 os: windows-2019 - - toolset: msvc-14.1 - cxxstd: "14,17,latest" - addrmd: 32,64 - os: windows-2016 - toolset: msvc-14.2 cxxstd: "14,17,20,latest" addrmd: 32,64 From 601ee4ba7ae9d9b532dab5f7e757f4187dce6300 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 13 Jun 2022 16:02:53 +0300 Subject: [PATCH 045/110] Use snprintf when available to avoid security warnings (refs #25) --- include/boost/assert/source_location.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 9ab5c29..cca87e7 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -73,6 +73,12 @@ struct source_location #if defined(BOOST_MSVC) # pragma warning( push ) # pragma warning( disable: 4996 ) +#endif + +#if ( defined(_MSC_VER) && _MSC_VER < 1900 ) || ( defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) ) +# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::sprintf(buffer, format, arg) +#else +# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::snprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), format, arg) #endif std::string to_string() const @@ -88,14 +94,14 @@ struct source_location char buffer[ 16 ]; - std::sprintf( buffer, ":%lu", ln ); + BOOST_ASSERT_SNPRINTF( buffer, ":%lu", ln ); r += buffer; unsigned long co = column(); if( co ) { - std::sprintf( buffer, ":%lu", co ); + BOOST_ASSERT_SNPRINTF( buffer, ":%lu", co ); r += buffer; } @@ -111,6 +117,8 @@ struct source_location return r; } +#undef BOOST_ASSERT_SNPRINTF + #if defined(BOOST_MSVC) # pragma warning( pop ) #endif From c3192e3cf166e65b32407b23dd84eedae6c0f685 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 13 Jun 2022 18:15:32 +0300 Subject: [PATCH 046/110] Update appveyor.yml --- appveyor.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 86a260c..059d54f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,6 +25,22 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 TOOLSET: msvc-14.2 CXXSTD: 14,17 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ADDPATH: C:\cygwin\bin; + TOOLSET: gcc + CXXSTD: 03,11,14,1z + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ADDPATH: C:\cygwin64\bin; + TOOLSET: gcc + CXXSTD: 03,11,14,1z + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ADDPATH: C:\mingw\bin; + TOOLSET: gcc + CXXSTD: 03,11,14,1z + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; + TOOLSET: gcc + CXXSTD: 03,11,14,1z - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 CMAKE: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 @@ -58,9 +74,10 @@ build: off test_script: + - PATH=%ADDPATH%%PATH% - if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% - - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% + - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - if not "%CMAKE%" == "" cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. From 0c194ba9d725c7de49f8623455b410a7a42266c0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 21 Jul 2022 13:47:42 +0300 Subject: [PATCH 047/110] Add msvc-14.1 with /ZI to appveyor.yml --- appveyor.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 059d54f..507a224 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,6 +22,10 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 TOOLSET: msvc-14.1,clang-win CXXSTD: 14,17 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + TOOLSET: msvc-14.1 + CXXSTD: 14,17 + CXXFLAGS: /ZI /FS - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 TOOLSET: msvc-14.2 CXXSTD: 14,17 @@ -77,7 +81,8 @@ test_script: - PATH=%ADDPATH%%PATH% - if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% - - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release + - if not "%CXXFLAGS%" == "" set CXXFLAGS=cxxflags="%CXXFLAGS%" + - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% %CXXFLAGS% variant=debug,release - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - if not "%CMAKE%" == "" cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. From fd1c92f71fb62bb6ebee3fc622a62223722f165f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 21 Jul 2022 14:07:24 +0300 Subject: [PATCH 048/110] Add /ZI jobs for 14.0 as well; update cxxstd --- appveyor.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 507a224..30765cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,14 +21,17 @@ environment: TOOLSET: msvc-12.0,msvc-14.0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 TOOLSET: msvc-14.1,clang-win - CXXSTD: 14,17 + CXXSTD: 14,17,latest + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + TOOLSET: msvc-14.0 + __CXXFLAGS__: /ZI /FS - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 TOOLSET: msvc-14.1 - CXXSTD: 14,17 - CXXFLAGS: /ZI /FS + CXXSTD: 14,17,latest + __CXXFLAGS__: /ZI /FS - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 TOOLSET: msvc-14.2 - CXXSTD: 14,17 + CXXSTD: 14,17,20,latest - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 ADDPATH: C:\cygwin\bin; TOOLSET: gcc @@ -81,8 +84,8 @@ test_script: - PATH=%ADDPATH%%PATH% - if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% - - if not "%CXXFLAGS%" == "" set CXXFLAGS=cxxflags="%CXXFLAGS%" - - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 3 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% %CXXFLAGS% variant=debug,release + - if not "%__CXXFLAGS__%" == "" set __CXXFLAGS__=cxxflags="%__CXXFLAGS__%" + - if "%CMAKE%%CMAKE_SUBDIR%%CMAKE_INSTALL%" == "" b2 -j 1 libs/assert/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% %__CXXFLAGS__% variant=debug,release - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - if not "%CMAKE%" == "" cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. From 3d6e55bddf6f12dbb2bf0ef634f1b145990854d3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 21 Jul 2022 18:51:54 +0300 Subject: [PATCH 049/110] Work around __LINE__ not being constant with /ZI (refs #26) --- include/boost/assert/source_location.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index cca87e7..0d76858 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -152,6 +152,15 @@ template std::basic_ostream & operator<<( std::basic_ost // the correct result under 19.31, so prefer the built-ins # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) +#elif defined(BOOST_MSVC) + +// __LINE__ is not a constant expression under /ZI (edit and continue) for 1925 and before + +# define BOOST_CURRENT_LOCATION_IMPL_1(x) BOOST_CURRENT_LOCATION_IMPL_2(x) +# define BOOST_CURRENT_LOCATION_IMPL_2(x) (x##0 / 10) + +# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, BOOST_CURRENT_LOCATION_IMPL_1(__LINE__), "") + #elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L # define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current()) From 7dea14cf7f21dcd5bc5d4cedfd22935878634cdf Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 21 Jul 2022 19:41:03 +0300 Subject: [PATCH 050/110] Update ci.yml --- .github/workflows/ci.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34f8621..990b551 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,10 @@ jobs: cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 install: g++-11 + - toolset: gcc-12 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 + install: g++-12 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" @@ -97,9 +101,19 @@ jobs: cxxstd: "03,11,14,17,2a" os: ubuntu-20.04 install: clang-12 + - toolset: clang + compiler: clang++-13 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 + install: clang-13 + - toolset: clang + compiler: clang++-14 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 + install: clang-14 - toolset: clang cxxstd: "03,11,14,17,2a" - os: macos-10.15 + os: macos-11 runs-on: ${{matrix.os}} @@ -208,7 +222,8 @@ jobs: include: - os: ubuntu-18.04 - os: ubuntu-20.04 - - os: macos-10.15 + - os: ubuntu-22.04 + - os: macos-11 runs-on: ${{matrix.os}} @@ -254,7 +269,8 @@ jobs: include: - os: ubuntu-18.04 - os: ubuntu-20.04 - - os: macos-10.15 + - os: ubuntu-22.04 + - os: macos-11 runs-on: ${{matrix.os}} @@ -310,7 +326,8 @@ jobs: include: - os: ubuntu-18.04 - os: ubuntu-20.04 - - os: macos-10.15 + - os: ubuntu-22.04 + - os: macos-11 runs-on: ${{matrix.os}} From d363ac30da9f8d3a745a832b62a84bd932c39be5 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 19 Aug 2022 10:30:19 -0700 Subject: [PATCH 051/110] add boost_assert.natvis and interface target sources for VS --- CMakeLists.txt | 6 ++++++ extra/boost_assert.natvis | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 extra/boost_assert.natvis diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ccdd9..835e143 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,12 @@ target_link_libraries(boost_assert INTERFACE Boost::config ) +file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) +source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES}) +if (CMAKE_GENERATOR MATCHES "Visual Studio") + list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) +endif() +target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) # BUILD_TESTING is the standard CTest variable that enables testing diff --git a/extra/boost_assert.natvis b/extra/boost_assert.natvis new file mode 100644 index 0000000..56bc7eb --- /dev/null +++ b/extra/boost_assert.natvis @@ -0,0 +1,14 @@ + + + + + {function_,sb} @ {file_,sb}:{line_} + + file_,sb + line_ + column_ + function_,sb + + + + From 363669eef5fbb0b6153edb6627e836a7c5bb924e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 28 Oct 2022 19:55:55 +0300 Subject: [PATCH 052/110] Update ci.yml --- .github/workflows/ci.yml | 190 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 185 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 990b551..eb11447 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install packages if: matrix.install @@ -185,7 +185,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Boost shell: cmd @@ -228,7 +228,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install packages if: matrix.install @@ -275,7 +275,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install packages if: matrix.install @@ -332,7 +332,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install packages if: matrix.install @@ -373,3 +373,183 @@ jobs: run: | cd ../boost-root/__build__ ctest --output-on-failure --no-tests=error + + windows-cmake-subdir: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Use library with add_subdirectory (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test + mkdir __build__ && cd __build__ + cmake .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use library with add_subdirectory (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-install: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. + + - name: Install (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Debug + + - name: Install (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Release + + - name: Use the installed library (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use the installed library (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON .. + + - name: Build tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Debug + + - name: Run tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Debug + + - name: Build tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Release + + - name: Run tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Release From ae8a7eea50afd93ae9157faaf40825f63c779ea0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 29 Oct 2022 18:51:05 +0300 Subject: [PATCH 053/110] Add --no-tests=error to ctest invocations --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 30765cf..da4eff1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -89,10 +89,10 @@ test_script: - if not "%CMAKE%" == "" mkdir __build__ && cd __build__ - if not "%CMAKE%" == "" cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=assert .. - - if not "%CMAKE%" == "" cmake --build . --target tests --config Debug & ctest --output-on-failure -C Debug - - if not "%CMAKE%" == "" cmake --build . --target tests --config Release & ctest --output-on-failure -C Release - - if not "%CMAKE%" == "" cmake --build . --target tests --config MinSizeRel & ctest --output-on-failure -C MinSizeRel - - if not "%CMAKE%" == "" cmake --build . --target tests --config RelWithDebInfo & ctest --output-on-failure -C RelWithDebInfo + - if not "%CMAKE%" == "" cmake --build . --target tests --config Debug & ctest --output-on-failure --no-tests=error -C Debug + - if not "%CMAKE%" == "" cmake --build . --target tests --config Release & ctest --output-on-failure --no-tests=error -C Release + - if not "%CMAKE%" == "" cmake --build . --target tests --config MinSizeRel & ctest --output-on-failure --no-tests=error -C MinSizeRel + - if not "%CMAKE%" == "" cmake --build . --target tests --config RelWithDebInfo & ctest --output-on-failure --no-tests=error -C RelWithDebInfo - if not "%CMAKE_SUBDIR%" == "" cd libs/assert/test/cmake_subdir_test && mkdir __build__ && cd __build__ - if not "%CMAKE_SUBDIR%" == "" cmake .. From db964b368723d3007986b93c1d02e3f35f225324 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 29 Oct 2022 19:48:37 +0300 Subject: [PATCH 054/110] Update .drone.jsonnet --- .drone.jsonnet | 132 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 107 insertions(+), 25 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index ded860a..73e044c 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -135,9 +135,9 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 16.04 GCC 5*", + "Linux 16.04 GCC 5* 32/64", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14', ADDRMD: '32,64' }, ), linux_pipeline( @@ -161,36 +161,43 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 20.04 GCC 9* 32", + "Linux 20.04 GCC 9* 32/64", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, ), linux_pipeline( - "Linux 20.04 GCC 9* 64", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '64' }, + "Linux 20.04 GCC 9 ARM64", + "cppalliance/droneubuntu2004:multiarch", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + arch="arm64", ), linux_pipeline( - "Linux 20.04 GCC 9 ARM64 32/64", + "Linux 20.04 GCC 9* S390x", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, - arch="arm64", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + arch="s390x", ), linux_pipeline( - "Linux 20.04 GCC 10 32 ASAN", + "Linux 20.04 GCC 10", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32' } + asan, - "g++-10-multilib", + { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20' }, + "g++-10", ), linux_pipeline( - "Linux 20.04 GCC 10 64 ASAN", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '64' } + asan, - "g++-10-multilib", + "Linux 22.04 GCC 11* 32/64", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 22.04 GCC 12 32/64 ASAN", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + asan, + "g++-12-multilib", ), linux_pipeline( @@ -222,27 +229,102 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 20.04 Clang 13", + "Linux 18.04 Clang 3.9", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' }, + "clang-3.9", + ), + + linux_pipeline( + "Linux 18.04 Clang 4.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' }, + "clang-4.0", + ), + + linux_pipeline( + "Linux 18.04 Clang 5.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14,1z' }, + "clang-5.0", + ), + + linux_pipeline( + "Linux 18.04 Clang 6.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' }, + "clang-6.0", + ), + + linux_pipeline( + "Linux 20.04 Clang 7", "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' }, + "clang-7", + ), + + linux_pipeline( + "Linux 20.04 Clang 8", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' }, + "clang-8", + ), + + linux_pipeline( + "Linux 20.04 Clang 9", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' }, + "clang-9", + ), + + linux_pipeline( + "Linux 20.04 Clang 10", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' }, + "clang-10", + ), + + linux_pipeline( + "Linux 20.04 Clang 11", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' }, + "clang-11", + ), + + linux_pipeline( + "Linux 20.04 Clang 12", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,2a' }, + "clang-12", + ), + + linux_pipeline( + "Linux 22.04 Clang 13", + "cppalliance/droneubuntu2204:1", { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' }, "clang-13", - ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"], ), linux_pipeline( - "Linux 20.04 Clang 14 UBSAN", - "cppalliance/droneubuntu2004:1", + "Linux 22.04 Clang 14 UBSAN", + "cppalliance/droneubuntu2204:1", { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + ubsan, "clang-14", - ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"], ), linux_pipeline( - "Linux 20.04 Clang 14 ASAN", - "cppalliance/droneubuntu2004:1", + "Linux 22.04 Clang 14 ASAN", + "cppalliance/droneubuntu2204:1", { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + asan, "clang-14", - ["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"], + ), + + linux_pipeline( + "Linux 22.04 Clang 15", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' }, + "clang-15", + ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], ), macos_pipeline( From 8633dd554b9521062e15f839a936145aa2846cb8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Jan 2023 05:38:07 +0200 Subject: [PATCH 055/110] Update CMakeLists.txt --- CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 835e143..6360a4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright 2018, 2019 Peter Dimov +# Copyright 2018-2023 Peter Dimov # Distributed under the Boost Software License, Version 1.0. -# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt +# https://www.boost.org/LICENSE_1_0.txt -# We support CMake 3.5, but prefer 3.16 policies and behavior -cmake_minimum_required(VERSION 3.5...3.16) +# We support CMake 3.5, but prefer 3.20 policies and behavior +cmake_minimum_required(VERSION 3.5...3.20) project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -16,12 +16,15 @@ target_link_libraries(boost_assert INTERFACE Boost::config ) -file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) -source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES}) -if (CMAKE_GENERATOR MATCHES "Visual Studio") - list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) + +if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") + + file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES}) + list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) + target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) + endif() -target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) # BUILD_TESTING is the standard CTest variable that enables testing From 4cf829bb0deaeed16a141dc881ff651335cf7d9f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Jan 2023 07:03:54 +0200 Subject: [PATCH 056/110] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6360a4d..6cfd4f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries(boost_assert if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES}) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES} PREFIX "Header Files") list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) From f10ddd608e087a89ee5bfc41cf2987cc5ef61473 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 3 Mar 2023 01:27:13 +0200 Subject: [PATCH 057/110] Update ci.yml --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb11447..f65eb56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,22 +19,26 @@ jobs: include: - toolset: gcc-4.8 cxxstd: "03,11" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-4.8 - toolset: gcc-5 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-5 - toolset: gcc-6 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-6 - toolset: gcc-7 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 + install: g++-7 - toolset: gcc-8 cxxstd: "03,11,14,17,2a" - os: ubuntu-18.04 + os: ubuntu-20.04 install: g++-8 - toolset: gcc-9 cxxstd: "03,11,14,17,2a" @@ -54,27 +58,30 @@ jobs: - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-3.9 - toolset: clang compiler: clang++-4.0 cxxstd: "03,11,14" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-4.0 - toolset: clang compiler: clang++-5.0 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-5.0 - toolset: clang compiler: clang++-6.0 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 install: clang-7 - toolset: clang compiler: clang++-8 @@ -111,18 +118,37 @@ jobs: cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: clang-14 + - toolset: clang + compiler: clang++-15 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 + install: clang-15 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-11 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-12 runs-on: ${{matrix.os}} + container: ${{matrix.container}} + + defaults: + run: + shell: bash steps: - uses: actions/checkout@v3 + - name: Setup container environment + if: matrix.container + run: | + apt-get update + apt-get -y install sudo python git g++ + - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -220,10 +246,10 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-18.04 - os: ubuntu-20.04 - os: ubuntu-22.04 - os: macos-11 + - os: macos-12 runs-on: ${{matrix.os}} @@ -232,7 +258,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -267,10 +293,10 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-18.04 - os: ubuntu-20.04 - os: ubuntu-22.04 - os: macos-11 + - os: macos-12 runs-on: ${{matrix.os}} @@ -279,7 +305,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -324,10 +350,10 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-18.04 - os: ubuntu-20.04 - os: ubuntu-22.04 - os: macos-11 + - os: macos-12 runs-on: ${{matrix.os}} @@ -336,7 +362,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | From 02256c84fd0cd58a139d9dc1b25b5019ca976ada Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Jun 2023 18:11:58 +0300 Subject: [PATCH 058/110] Do not use std::source_location::current under nvcc. Fixes #32. --- include/boost/assert/source_location.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 0d76858..09770f7 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -161,7 +161,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, BOOST_CURRENT_LOCATION_IMPL_1(__LINE__), "") -#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L +#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !defined(__NVCC__) + +// Under nvcc, __builtin_source_location is not constexpr +// https://github.com/boostorg/assert/issues/32 # define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current()) From cdf8b25e6474af7fff1789e917383e6fa4a85ca8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 11 Oct 2023 18:31:27 +0300 Subject: [PATCH 059/110] Remove unnecessary includes --- include/boost/assert/source_location.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 09770f7..a265ad5 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -7,9 +7,7 @@ // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt -#include #include -#include #include #include #include From 5227f10a99442da67415e9649be2b4d9df53b61e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 11 Oct 2023 18:45:57 +0300 Subject: [PATCH 060/110] Update ci.yml --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f65eb56..80ac8f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,11 @@ jobs: cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: g++-12 + - toolset: gcc-13 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:23.04 + install: g++-13 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" @@ -123,12 +128,21 @@ jobs: cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: clang-15 + - toolset: clang + compiler: clang++-16 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:23.04 + install: clang-16 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-11 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-12 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-13 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -144,11 +158,13 @@ jobs: if: matrix.container run: | apt-get update - apt-get -y install sudo python git g++ + apt-get -y install sudo python3 git g++ - name: Install packages if: matrix.install - run: sudo apt-get -y install ${{matrix.install}} + run: | + sudo apt-get update + sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -168,7 +184,7 @@ jobs: cd boost-root cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY ./bootstrap.sh ./b2 -d0 headers @@ -188,7 +204,7 @@ jobs: matrix: include: - toolset: msvc-14.0 - cxxstd: "14" + cxxstd: "14,latest" addrmd: 32,64 os: windows-2019 - toolset: msvc-14.2 @@ -250,6 +266,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} @@ -297,6 +314,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} @@ -354,6 +372,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} From 23bdea693b6c2c2aa0938c8bb51ec70dfcac5fd6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Nov 2023 21:19:01 +0200 Subject: [PATCH 061/110] Update ci.yml --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80ac8f3..d1cd10f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,17 +116,20 @@ jobs: - toolset: clang compiler: clang++-13 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-13 - toolset: clang compiler: clang++-14 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-14 - toolset: clang compiler: clang++-15 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-15 - toolset: clang compiler: clang++-16 @@ -134,6 +137,12 @@ jobs: os: ubuntu-latest container: ubuntu:23.04 install: clang-16 + - toolset: clang + compiler: clang++-17 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:23.10 + install: clang-17 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-11 From 8919429f41799cdcf37dcf7c2836379d287a809e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Nov 2023 21:29:59 +0200 Subject: [PATCH 062/110] Update source_location_test.cpp --- test/source_location_test.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index dc087bb..e3e7311 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -4,6 +4,21 @@ #include #include +#include + +static char const* adjust_filename( char const* file ) +{ +#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20210300 + + char const* fn = std::strrchr( file, '/' ); + return fn? fn + 1: file; + +#else + + return file; + +#endif +} int main() { @@ -20,7 +35,7 @@ int main() boost::source_location loc( __FILE__, __LINE__, "main()" ); BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( loc.line(), 20 ); + BOOST_TEST_EQ( loc.line(), 35 ); BOOST_TEST_CSTR_EQ( loc.function_name(), "main()" ); BOOST_TEST_EQ( loc.column(), 0 ); } @@ -37,15 +52,15 @@ int main() { boost::source_location loc = BOOST_CURRENT_LOCATION; - BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( loc.line(), 38 ); + BOOST_TEST_CSTR_EQ( loc.file_name(), adjust_filename(__FILE__) ); + BOOST_TEST_EQ( loc.line(), 53 ); } { BOOST_STATIC_CONSTEXPR boost::source_location loc = BOOST_CURRENT_LOCATION; - BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( loc.line(), 45 ); + BOOST_TEST_CSTR_EQ( loc.file_name(), adjust_filename(__FILE__) ); + BOOST_TEST_EQ( loc.line(), 60 ); } #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L From 2934b3ffb8d3e198db9a4a0cce149c856103040c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Nov 2023 21:36:18 +0200 Subject: [PATCH 063/110] Update source_location_test3.cpp --- test/source_location_test3.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index 6d01a4b..810c3ee 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -5,6 +5,21 @@ #include #include #include +#include + +static char const* adjust_filename( char const* file ) +{ +#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20210300 + + char const* fn = std::strrchr( file, '/' ); + return fn? fn + 1: file; + +#else + + return file; + +#endif +} int main() { @@ -61,7 +76,7 @@ int main() { boost::source_location loc = BOOST_CURRENT_LOCATION; - std::string prefix = std::string( __FILE__ ) + ":62"; + std::string prefix = std::string( adjust_filename(__FILE__) ) + ":77"; BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); std::ostringstream os; From 9067f0987bb952d8ff266529d03e39aa1af3ffee Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Nov 2023 21:43:16 +0200 Subject: [PATCH 064/110] Update source_location_test4.cpp --- test/source_location_test4.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/test/source_location_test4.cpp b/test/source_location_test4.cpp index 420612e..1242314 100644 --- a/test/source_location_test4.cpp +++ b/test/source_location_test4.cpp @@ -5,6 +5,21 @@ #include #include #include +#include + +static char const* adjust_filename( char const* file ) +{ +#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20210300 + + char const* fn = std::strrchr( file, '/' ); + return fn? fn + 1: file; + +#else + + return file; + +#endif +} boost::source_location s_loc = BOOST_CURRENT_LOCATION; @@ -18,8 +33,8 @@ boost::source_location f( boost::source_location const& loc = BOOST_CURRENT_LOCA int main() { { - BOOST_TEST_CSTR_EQ( s_loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( s_loc.line(), 9 ); + BOOST_TEST_CSTR_EQ( s_loc.file_name(), adjust_filename(__FILE__) ); + BOOST_TEST_EQ( s_loc.line(), 24 ); #if defined(BOOST_GCC) && BOOST_GCC < 90000 // '__static_initialization_and_destruction_0' @@ -29,15 +44,15 @@ int main() } { - BOOST_TEST_CSTR_EQ( c_loc.file_name(), __FILE__ ); - BOOST_TEST_EQ( c_loc.line(), 11 ); + BOOST_TEST_CSTR_EQ( c_loc.file_name(), adjust_filename(__FILE__) ); + BOOST_TEST_EQ( c_loc.line(), 26 ); } { boost::source_location loc = f(); - BOOST_TEST_CSTR_EQ( loc.file_name(), __FILE__ ); - BOOST_TEST( loc.line() == 13 || loc.line() == 37 ); + BOOST_TEST_CSTR_EQ( loc.file_name(), adjust_filename(__FILE__) ); + BOOST_TEST( loc.line() == 28 || loc.line() == 52 ); } return boost::report_errors(); From 3010f72c4ecb72af1795a42618077e55802c22c3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 16 Dec 2023 18:10:03 +0200 Subject: [PATCH 065/110] Testing the CMake project version is no longer needed --- test/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d6be2c9..8703c22 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,8 +8,4 @@ if(HAVE_BOOST_TEST) boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::assert Boost::core) -if(BOOST_SUPERPROJECT_VERSION) - boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION} LINK_LIBRARIES Boost::core Boost::config) -endif() - endif() From e876817d8f94c8dba24094132d479256e4dc225e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 1 Jan 2024 19:32:46 +0200 Subject: [PATCH 066/110] Update .drone.jsonnet --- .drone.jsonnet | 67 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 73e044c..3e4af2b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -97,41 +97,40 @@ local windows_pipeline(name, image, environment, arch = "amd64") = [ linux_pipeline( - "Linux 14.04 GCC 4.4", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.4", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' }, "g++-4.4", [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( - "Linux 14.04 GCC 4.6", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.6", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x' }, "g++-4.6", [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( - "Linux 14.04 GCC 4.7", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.7", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x' }, "g++-4.7", - [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( - "Linux 14.04 GCC 4.8*", - "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11' }, + "Linux 16.04 GCC 4.8", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.8', CXXSTD: '03,11' }, + "g++-4.8", ), linux_pipeline( - "Linux 14.04 GCC 4.9", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.9", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11' }, "g++-4.9", - [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( @@ -200,6 +199,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-12-multilib", ), + linux_pipeline( + "Linux 23.04 GCC 13 32/64 UBSAN", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, + "g++-13-multilib", + ), + linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", @@ -306,16 +312,9 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 22.04 Clang 14 UBSAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + ubsan, - "clang-14", - ), - - linux_pipeline( - "Linux 22.04 Clang 14 ASAN", + "Linux 22.04 Clang 14", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' }, "clang-14", ), @@ -324,7 +323,27 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "cppalliance/droneubuntu2204:1", { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' }, "clang-15", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], + ), + + linux_pipeline( + "Linux 23.04 Clang 16", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' }, + "clang-16", + ), + + linux_pipeline( + "Linux 23.10 Clang 17 UBSAN", + "cppalliance/droneubuntu2310:1", + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, + "clang-17", + ), + + linux_pipeline( + "Linux 23.10 Clang 17 ASAN", + "cppalliance/droneubuntu2310:1", + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan, + "clang-17", ), macos_pipeline( @@ -340,7 +359,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = windows_pipeline( "Windows VS2015 msvc-14.0", "cppalliance/dronevs2015", - { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' }, + { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' }, ), windows_pipeline( From 19bae9ff561bdce3295e37df6ec17a2d17fe6154 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 1 Jan 2024 19:53:45 +0200 Subject: [PATCH 067/110] Add Xcode 13.4 to Drone --- .drone.jsonnet | 12 ++++++++++++ .drone/drone.sh | 1 + 2 files changed, 13 insertions(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index 3e4af2b..30e3061 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -356,6 +356,18 @@ local windows_pipeline(name, image, environment, arch = "amd64") = { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + asan, ), + macos_pipeline( + "MacOS 12.4 Xcode 13.4.1 UBSAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + ubsan, + xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", + ), + + macos_pipeline( + "MacOS 12.4 Xcode 13.4.1 ASAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + asan, + xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", + ), + windows_pipeline( "Windows VS2015 msvc-14.0", "cppalliance/dronevs2015", diff --git a/.drone/drone.sh b/.drone/drone.sh index 7172f7f..2f2125d 100755 --- a/.drone/drone.sh +++ b/.drone/drone.sh @@ -5,6 +5,7 @@ # https://www.boost.org/LICENSE_1_0.txt set -ex +export PATH=~/.local/bin:/usr/local/bin:$PATH DRONE_BUILD_DIR=$(pwd) From a2817b89f48a8fdbe4130762d0d47a355ca5b562 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 1 Jan 2024 20:18:53 +0200 Subject: [PATCH 068/110] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index da4eff1..151d267 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ branches: environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0 ADDRMD: 32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 From 2e78ba22acee1988cd5852be2414638596ec0984 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 3 Feb 2024 20:21:07 +0200 Subject: [PATCH 069/110] Update ci.yml --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1cd10f..7a3d0a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,7 +236,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -280,7 +280,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -328,7 +328,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -386,7 +386,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -439,7 +439,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -488,7 +488,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -555,7 +555,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd From 447e0b3a331930f8708ade0e42683d12de9dfbc3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 3 Feb 2024 20:43:55 +0200 Subject: [PATCH 070/110] Use __builtin_FUNCSIG() under MSVC 19.35+. Fixes #35. --- include/boost/assert/source_location.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index a265ad5..c4d5f1b 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -144,6 +144,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location() +#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1935 + +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCSIG(), __builtin_COLUMN()) + #elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926 // std::source_location::current() is available in -std:c++20, but fails with consteval errors before 19.31, and doesn't produce From ca3c3c9021e5b1941a18dbbfacc24fa212f95e20 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Mar 2024 08:27:02 -0500 Subject: [PATCH 071/110] Make the library modular usable. --- build.jam | 20 ++++++++++++++++++++ test/Jamfile.v2 | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..58655ad --- /dev/null +++ b/build.jam @@ -0,0 +1,20 @@ +# Copyright René Ferdinand Rivera Morell 2023 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import project ; + +project /boost/assert + : common-requirements + /boost/config//boost_config + include + ; + +explicit + [ alias boost_assert ] + [ alias all : boost_assert test ] + ; + +call-if : boost-library assert + ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ffe840e..d7a7472 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -9,6 +9,8 @@ import testing ; project : requirements + /boost/core//boost_core + extra msvc:on clang:on From 15b8bffd8be5e29f49b26511be3999e3bf7fc6c8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 29 Mar 2024 21:12:36 -0500 Subject: [PATCH 072/110] Switch to library requirements instead of source. As source puts extra source in install targets. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 58655ad..3396755 100644 --- a/build.jam +++ b/build.jam @@ -7,7 +7,7 @@ import project ; project /boost/assert : common-requirements - /boost/config//boost_config + /boost/config//boost_config include ; From 1b44529726a0806ec24b607f8162581ad3268743 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 16 Apr 2024 19:44:56 +0300 Subject: [PATCH 073/110] Update doc/Jamfile --- doc/Jamfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/Jamfile b/doc/Jamfile index 5943a2a..106dc59 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -4,14 +4,10 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import asciidoctor ; -# import boostbook ; +using asciidoctor ; html assert.html : index.adoc ; -# docbook assert.docbook : index.adoc ; -# boostbook assert.html : assert.docbook : onehtml ; - install html_ : assert.html : html ; pdf assert.pdf : index.adoc ; From e4142c28337657832b253cd8e85cc1ede8f69831 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 16 Apr 2024 22:38:17 +0300 Subject: [PATCH 074/110] Switch back to import, because `using asciidoctor ;` overwrites the command --- doc/Jamfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Jamfile b/doc/Jamfile index 106dc59..539ce26 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -4,7 +4,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -using asciidoctor ; +import asciidoctor ; html assert.html : index.adoc ; From e55ad868ec2074d6d954e67cc327619ac913f7f9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 5 May 2024 09:00:00 -0500 Subject: [PATCH 075/110] Add requires-b2 check to top-level build file. --- build.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.jam b/build.jam index 3396755..150ab8f 100644 --- a/build.jam +++ b/build.jam @@ -3,6 +3,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +require-b2 5.1 ; + import project ; project /boost/assert From 425b5ba31b0667439fb72dbf9ce425af6ef1b094 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 May 2024 04:54:41 +0300 Subject: [PATCH 076/110] Update ci.yml --- .github/workflows/ci.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a3d0a2..0041fd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: install: g++-10 - toolset: gcc-11 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-22.04 install: g++-11 - toolset: gcc-12 cxxstd: "03,11,14,17,20,2b" @@ -60,6 +60,11 @@ jobs: os: ubuntu-latest container: ubuntu:23.04 install: g++-13 + - toolset: gcc-14 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:24.04 + install: g++-14 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" @@ -144,14 +149,20 @@ jobs: container: ubuntu:23.10 install: clang-17 - toolset: clang - cxxstd: "03,11,14,17,2a" - os: macos-11 + compiler: clang++-18 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:24.04 + install: clang-18 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-12 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-13 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-14 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -273,9 +284,9 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} @@ -321,9 +332,9 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} @@ -379,9 +390,9 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} From 90a5937d925e657750b446ed7aa84a399c416d86 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2024 11:33:55 -0500 Subject: [PATCH 077/110] Bump B2 require to 5.2 --- build.jam | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.jam b/build.jam index 150ab8f..d2db700 100644 --- a/build.jam +++ b/build.jam @@ -3,9 +3,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -require-b2 5.1 ; - -import project ; +require-b2 5.2 ; project /boost/assert : common-requirements From 242fdfb1373127331cb229379b50b1dba0f53e49 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 3 Jul 2024 21:32:29 +0300 Subject: [PATCH 078/110] Require GCC 8 for __builtin_FILE for reproducible builds. Fixes #38. --- include/boost/assert/source_location.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index c4d5f1b..c6eae32 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -174,9 +174,12 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION(), __builtin_COLUMN()) -#elif defined(BOOST_GCC) && BOOST_GCC >= 70000 +#elif defined(BOOST_GCC) && BOOST_GCC >= 80000 // The built-ins are available in 4.8+, but are not constant expressions until 7 +// In addition, reproducible builds require -ffile-prefix-map, which is GCC 8 +// https://github.com/boostorg/assert/issues/38 + # define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCTION()) #elif defined(BOOST_GCC) && BOOST_GCC >= 50000 From 81c9b793b984e1ca0991951c7f260daf387de120 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 19:36:54 -0500 Subject: [PATCH 079/110] Change all references to . --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d7a7472..9894dc1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -9,7 +9,7 @@ import testing ; project : requirements - /boost/core//boost_core + /boost/core//boost_core extra msvc:on From 4f5467f387b676c61d5794fb79cf360fe7ac20cf Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 22:52:05 -0500 Subject: [PATCH 080/110] Update copyright dates. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index d2db700..de45ccf 100644 --- a/build.jam +++ b/build.jam @@ -1,4 +1,4 @@ -# Copyright René Ferdinand Rivera Morell 2023 +# Copyright René Ferdinand Rivera Morell 2023-2024 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) From 65089bdd69d1698b4489be9c28bc7863519ca541 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 23 Jul 2024 22:34:23 -0500 Subject: [PATCH 081/110] Move inter-lib dependencies to a project variable and into the build targets. --- build.jam | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.jam b/build.jam index de45ccf..3c573ed 100644 --- a/build.jam +++ b/build.jam @@ -5,16 +5,19 @@ require-b2 5.2 ; +constant boost_dependencies : + /boost/config//boost_config ; + project /boost/assert : common-requirements - /boost/config//boost_config include ; explicit - [ alias boost_assert ] + [ alias boost_assert : : : : $(boost_dependencies) ] [ alias all : boost_assert test ] ; call-if : boost-library assert ; + From a4bafa6b48f3a4bfecd9792a3cca3310ba9b6546 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Aug 2024 18:19:23 +0300 Subject: [PATCH 082/110] Update ci.yml --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0041fd6..47eb671 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,6 +172,10 @@ jobs: shell: bash steps: + - name: Enable Node 16 + run: | + echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV + - uses: actions/checkout@v3 - name: Setup container environment From f377d8854454b3e594b650f667fe7dbf8b9ade62 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Aug 2024 18:29:08 +0300 Subject: [PATCH 083/110] Update .drone.jsonnet --- .drone.jsonnet | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 30e3061..c8729ac 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -166,7 +166,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 20.04 GCC 9 ARM64", + "Linux 20.04 GCC 9* ARM64", "cppalliance/droneubuntu2004:multiarch", { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, arch="arm64", @@ -193,19 +193,33 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 22.04 GCC 12 32/64 ASAN", + "Linux 22.04 GCC 12 32/64", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' }, "g++-12-multilib", ), linux_pipeline( - "Linux 23.04 GCC 13 32/64 UBSAN", + "Linux 23.04 GCC 13 32/64", "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' }, "g++-13-multilib", ), + linux_pipeline( + "Linux 24.04 GCC 14 32/64 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + asan, + "g++-14-multilib", + ), + + linux_pipeline( + "Linux 24.04 GCC 14 32/64 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, + "g++-14-multilib", + ), + linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", @@ -328,24 +342,38 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 23.04 Clang 16", "cppalliance/droneubuntu2304:1", - { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' }, + { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' }, "clang-16", ), linux_pipeline( "Linux 23.10 Clang 17 UBSAN", "cppalliance/droneubuntu2310:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + ubsan, "clang-17", ), linux_pipeline( "Linux 23.10 Clang 17 ASAN", "cppalliance/droneubuntu2310:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + asan, "clang-17", ), + linux_pipeline( + "Linux 24.04 Clang 18 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + "clang-18", + ), + + linux_pipeline( + "Linux 24.04 Clang 18 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + asan, + "clang-18", + ), + macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan, From 710894bd77201a6a05b9589e4516b16cc594be15 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Aug 2024 18:46:54 +0300 Subject: [PATCH 084/110] Update build.jam --- build.jam | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/build.jam b/build.jam index 3c573ed..c2bd74a 100644 --- a/build.jam +++ b/build.jam @@ -1,23 +1,20 @@ -# Copyright René Ferdinand Rivera Morell 2023-2024 +# Copyright 2023-2024 René Ferdinand Rivera Morell +# Copyright 2024 Peter Dimov # Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) +# https://www.boost.org/LICENSE_1_0.txt require-b2 5.2 ; constant boost_dependencies : - /boost/config//boost_config ; - -project /boost/assert - : common-requirements - include + /boost/config//boost_config ; +project /boost/assert ; + explicit - [ alias boost_assert : : : : $(boost_dependencies) ] + [ alias boost_assert : : : : include $(boost_dependencies) ] [ alias all : boost_assert test ] ; call-if : boost-library assert ; - From 36113dc5361c7ccb1f6064549763173aadf6092e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Aug 2024 18:48:07 +0300 Subject: [PATCH 085/110] Add VERBATIM to add_custom_target --- test/cmake_install_test/CMakeLists.txt | 2 +- test/cmake_subdir_test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cmake_install_test/CMakeLists.txt b/test/cmake_install_test/CMakeLists.txt index 33510df..b8b5518 100644 --- a/test/cmake_install_test/CMakeLists.txt +++ b/test/cmake_install_test/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries(main Boost::assert) enable_testing() add_test(NAME main COMMAND main) -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) +add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index 6a159a1..6af7005 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -15,4 +15,4 @@ target_link_libraries(main Boost::assert) enable_testing() add_test(NAME main COMMAND main) -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) +add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) From 2242cfb58269c03328957860006076386e7fa356 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 21 Aug 2024 10:46:01 +0300 Subject: [PATCH 086/110] Update .drone.jsonnet --- .drone.jsonnet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index c8729ac..852fddb 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -32,6 +32,8 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch commands: [ 'set -e', + 'uname -a', + 'echo $DRONE_STAGE_MACHINE', 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', ] + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + From 7f375288a10cc8d7608761dfa89ee1bad30cba18 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 9 Nov 2024 14:48:10 +0200 Subject: [PATCH 087/110] Update .drone.jsonnet --- .drone.jsonnet | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 852fddb..eedeca6 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -202,10 +202,9 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 GCC 13 32/64", - "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' }, - "g++-13-multilib", + "Linux 24.04 GCC 13* 32/64", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' }, ), linux_pipeline( @@ -342,23 +341,16 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 Clang 16", - "cppalliance/droneubuntu2304:1", + "Linux 24.04 Clang 16", + "cppalliance/droneubuntu2404:1", { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' }, "clang-16", ), linux_pipeline( - "Linux 23.10 Clang 17 UBSAN", - "cppalliance/droneubuntu2310:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + ubsan, - "clang-17", - ), - - linux_pipeline( - "Linux 23.10 Clang 17 ASAN", - "cppalliance/droneubuntu2310:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + asan, + "Linux 24.04 Clang 17", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' }, "clang-17", ), @@ -376,6 +368,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "clang-18", ), + linux_pipeline( + "Linux 24.10 Clang 19", + "cppalliance/droneubuntu2410:1", + { TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' }, + "clang-19", + ), + macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan, From a8827614098bb409870e915ad89e3ff07b04ca8c Mon Sep 17 00:00:00 2001 From: "T.Yamada" Date: Sat, 9 Nov 2024 22:16:01 +0900 Subject: [PATCH 088/110] Introduced BOOST_ASSERT_HANDLER_IS_NORETURN to make sure short-circuit work (#40) * Introduced BOOST_ENABLE_ASSERT_HANDLER_NORETURN to make sure short-circuit work * Use BOOST_ASSERT_HANDLER_IS_NORETURN --- include/boost/assert.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/assert.hpp b/include/boost/assert.hpp index 9650d7a..48c9bcc 100644 --- a/include/boost/assert.hpp +++ b/include/boost/assert.hpp @@ -46,7 +46,13 @@ namespace boost { +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined } // namespace boost From c9cd75e0909d3ce14d7f358968fc79fa3517839d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 9 Nov 2024 15:21:22 +0200 Subject: [PATCH 089/110] Update documentation --- doc/assert.adoc | 6 ++++++ doc/changes.adoc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/doc/assert.adoc b/doc/assert.adoc index 4628e07..e050488 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -46,6 +46,9 @@ This is true regardless of whether `NDEBUG` is defined. ``` namespace boost { +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed(char const * expr, char const * function, char const * file, long line); } @@ -87,6 +90,9 @@ This is true regardless of whether `NDEBUG` is defined. ``` namespace boost { +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); } diff --git a/doc/changes.adoc b/doc/changes.adoc index 782c37b..b7d6f5b 100644 --- a/doc/changes.adoc +++ b/doc/changes.adoc @@ -10,6 +10,11 @@ http://www.boost.org/LICENSE_1_0.txt :toc-title: :idprefix: +## Changes in 1.88.0 + +* When `BOOST_ASSERT_HANDLER_IS_NORETURN` is defined, `boost::assertion_failed` + and `boost::assertion_failed_msg` are declared as `BOOST_NORETURN`. + ## Changes in 1.79.0 * `source_location().file_name()` and `source_location().function_name()` From 9674ea262507c7d13a4b824fa7b3c998d6c1c91c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Dec 2024 20:00:46 +0200 Subject: [PATCH 090/110] Update ci.yml --- .github/workflows/ci.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47eb671..fff9481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - toolset: gcc-13 cxxstd: "03,11,14,17,20,2b" os: ubuntu-latest - container: ubuntu:23.04 + container: ubuntu:24.04 install: g++-13 - toolset: gcc-14 cxxstd: "03,11,14,17,20,2b" @@ -140,13 +140,13 @@ jobs: compiler: clang++-16 cxxstd: "03,11,14,17,20,2b" os: ubuntu-latest - container: ubuntu:23.04 + container: ubuntu:24.04 install: clang-16 - toolset: clang compiler: clang++-17 cxxstd: "03,11,14,17,20,2b" os: ubuntu-latest - container: ubuntu:23.10 + container: ubuntu:24.04 install: clang-17 - toolset: clang compiler: clang++-18 @@ -155,14 +155,20 @@ jobs: container: ubuntu:24.04 install: clang-18 - toolset: clang + compiler: clang++-19 cxxstd: "03,11,14,17,20,2b" - os: macos-12 + os: ubuntu-latest + container: ubuntu:24.10 + install: clang-19 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-13 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-14 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-15 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -288,9 +294,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} @@ -336,9 +343,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} @@ -394,9 +402,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} From fa72d2f0fd5adaf128b6fef80e0168fc1cc1bbb9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Dec 2024 20:05:37 +0200 Subject: [PATCH 091/110] Apply Node20 workaround --- .github/workflows/ci.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fff9481..48b5a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,24 +171,32 @@ jobs: os: macos-15 runs-on: ${{matrix.os}} - container: ${{matrix.container}} + + container: + image: ${{matrix.container}} + volumes: + - /node20217:/node20217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} defaults: run: shell: bash steps: - - name: Enable Node 16 - run: | - echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV - - - uses: actions/checkout@v3 - - name: Setup container environment if: matrix.container run: | apt-get update - apt-get -y install sudo python3 git g++ + apt-get -y install sudo python3 git g++ curl xz-utils + + - name: Install nodejs20glibc2.17 + if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }} + run: | + curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz + tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 + ldd /__e/node20/bin/node + + - uses: actions/checkout@v4 - name: Install packages if: matrix.install From 35c20462645ce55c60014537025100a53016a702 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 21 Mar 2025 16:49:35 +0200 Subject: [PATCH 092/110] Update ci.yml --- .github/workflows/ci.yml | 56 +++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48b5a68..b8db712 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,33 +19,37 @@ jobs: include: - toolset: gcc-4.8 cxxstd: "03,11" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-4.8 - toolset: gcc-5 cxxstd: "03,11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-5 - toolset: gcc-6 cxxstd: "03,11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-6 - toolset: gcc-7 cxxstd: "03,11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-7 - toolset: gcc-8 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-8 - toolset: gcc-9 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest - toolset: gcc-10 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-10 - toolset: gcc-11 cxxstd: "03,11,14,17,2a" @@ -68,55 +72,62 @@ jobs: - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-3.9 - toolset: clang compiler: clang++-4.0 cxxstd: "03,11,14" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-4.0 - toolset: clang compiler: clang++-5.0 cxxstd: "03,11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-5.0 - toolset: clang compiler: clang++-6.0 cxxstd: "03,11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "03,11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-7 - toolset: clang compiler: clang++-8 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-8 - toolset: clang compiler: clang++-9 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-9 - toolset: clang compiler: clang++-10 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-10 - toolset: clang compiler: clang++-11 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-11 - toolset: clang compiler: clang++-12 cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-12 - toolset: clang compiler: clang++-13 @@ -139,26 +150,26 @@ jobs: - toolset: clang compiler: clang++-16 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:24.04 + os: ubuntu-latest install: clang-16 - toolset: clang compiler: clang++-17 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:24.04 + os: ubuntu-latest install: clang-17 - toolset: clang compiler: clang++-18 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:24.04 + os: ubuntu-latest install: clang-18 - toolset: clang compiler: clang++-19 cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:24.10 + os: ubuntu-latest install: clang-19 - toolset: clang cxxstd: "03,11,14,17,20,2b" @@ -300,7 +311,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - os: ubuntu-22.04 - os: ubuntu-24.04 - os: macos-13 @@ -349,7 +359,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - os: ubuntu-22.04 - os: ubuntu-24.04 - os: macos-13 @@ -408,7 +417,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - os: ubuntu-22.04 - os: ubuntu-24.04 - os: macos-13 From 5dcb2af5213ae132b7531e45e7f93258cc33ffd8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 21 Mar 2025 17:00:47 +0200 Subject: [PATCH 093/110] Do not include or declare operator<< when BOOST_NO_IOSTREAM is defined. Fixes #43. --- include/boost/assert/source_location.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index c6eae32..3c2d60e 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -9,11 +9,14 @@ #include #include -#include #include #include #include +#if !defined(BOOST_NO_IOSTREAM) +#include +#endif + #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L # include #endif @@ -132,12 +135,16 @@ struct source_location } }; +#if !defined(BOOST_NO_IOSTREAM) + template std::basic_ostream & operator<<( std::basic_ostream & os, source_location const & loc ) { os << loc.to_string(); return os; } +#endif + } // namespace boost #if defined(BOOST_DISABLE_CURRENT_LOCATION) From d9efd1a6396e1dab8e07a4099c5d0e3a2e613294 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 02:52:19 +0300 Subject: [PATCH 094/110] Update ci.yml --- .github/workflows/ci.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8db712..1430270 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,9 +168,15 @@ jobs: - toolset: clang compiler: clang++-19 cxxstd: "03,11,14,17,20,2b" - container: ubuntu:24.10 + container: ubuntu:24.04 os: ubuntu-latest install: clang-19 + - toolset: clang + compiler: clang++-20 + cxxstd: "03,11,14,17,20,23,2c" + container: ubuntu:24.04 + os: ubuntu-latest + install: clang-20 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-13 @@ -252,14 +258,6 @@ jobs: fail-fast: false matrix: include: - - toolset: msvc-14.0 - cxxstd: "14,latest" - addrmd: 32,64 - os: windows-2019 - - toolset: msvc-14.2 - cxxstd: "14,17,20,latest" - addrmd: 32,64 - os: windows-2019 - toolset: msvc-14.3 cxxstd: "14,17,20,latest" addrmd: 32,64 @@ -271,7 +269,7 @@ jobs: - toolset: gcc cxxstd: "03,11,14,17,2a" addrmd: 64 - os: windows-2019 + os: windows-2022 runs-on: ${{matrix.os}} @@ -473,8 +471,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} @@ -522,8 +519,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} @@ -589,8 +585,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} From 96992d16dd0b9b6ea919549bca93166c764333f6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 18 Oct 2025 22:44:48 +0300 Subject: [PATCH 095/110] Add boost_assert.natvis as PUBLIC, to enable its installation; remove check for CMake 3.19 and Visual Studio --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cfd4f4..bac58c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright 2018-2023 Peter Dimov +# Copyright 2018-2025 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -# We support CMake 3.5, but prefer 3.20 policies and behavior -cmake_minimum_required(VERSION 3.5...3.20) +# We support CMake 3.8, but prefer 3.31 policies and behavior +cmake_minimum_required(VERSION 3.8...3.31) project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -17,14 +17,14 @@ target_link_libraries(boost_assert Boost::config ) -if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") +# Add headers and .natvis to project, for better IDE integration - file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES} PREFIX "Header Files") - list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) - target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) +file(GLOB_RECURSE boost_assert_HDRFILES CONFIGURE_DEPENDS include/*.hpp) +source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HDRFILES} PREFIX "Header Files") +target_sources(boost_assert PRIVATE ${boost_assert_HDRFILES}) +unset(boost_assert_HDRFILES) -endif() +target_sources(boost_assert PUBLIC extra/boost_assert.natvis) # BUILD_TESTING is the standard CTest variable that enables testing From 448cd0bc48e52c99127ad75ce2ddfcec0b9d98b1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 10:43:01 +0300 Subject: [PATCH 096/110] Revert "Add boost_assert.natvis as PUBLIC, to enable its installation; remove check for CMake 3.19 and Visual Studio" This reverts commit 96992d16dd0b9b6ea919549bca93166c764333f6. --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bac58c2..6cfd4f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright 2018-2025 Peter Dimov +# Copyright 2018-2023 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -# We support CMake 3.8, but prefer 3.31 policies and behavior -cmake_minimum_required(VERSION 3.8...3.31) +# We support CMake 3.5, but prefer 3.20 policies and behavior +cmake_minimum_required(VERSION 3.5...3.20) project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -17,14 +17,14 @@ target_link_libraries(boost_assert Boost::config ) -# Add headers and .natvis to project, for better IDE integration +if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") -file(GLOB_RECURSE boost_assert_HDRFILES CONFIGURE_DEPENDS include/*.hpp) -source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HDRFILES} PREFIX "Header Files") -target_sources(boost_assert PRIVATE ${boost_assert_HDRFILES}) -unset(boost_assert_HDRFILES) + file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES} PREFIX "Header Files") + list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) + target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) -target_sources(boost_assert PUBLIC extra/boost_assert.natvis) +endif() # BUILD_TESTING is the standard CTest variable that enables testing From 1069d7b790d972c396404a2130af00c3cfefbffa Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 10:52:58 +0300 Subject: [PATCH 097/110] Add boost_assert.natvis as PUBLIC, to enable its installation --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cfd4f4..679e038 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2018-2023 Peter Dimov +# Copyright 2018-2025 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt @@ -17,13 +17,18 @@ target_link_libraries(boost_assert Boost::config ) +# Add headers and .natvis to project, for better IDE integration + if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") + # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 + file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES} PREFIX "Header Files") - list(APPEND boost_assert_IDEFILES extra/boost_assert.natvis) target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) + target_sources(boost_assert PUBLIC extra/boost_assert.natvis) + endif() # BUILD_TESTING is the standard CTest variable that enables testing From 70bf9b6156cfa18624e7e5a8f34665720343aeae Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 10:57:08 +0300 Subject: [PATCH 098/110] Rename boost_assert_IDEFILES variable to boost_assert_HEADERS --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 679e038..45f5f44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,10 @@ if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 - file(GLOB_RECURSE boost_assert_IDEFILES CONFIGURE_DEPENDS include/*.hpp) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_IDEFILES} PREFIX "Header Files") - target_sources(boost_assert PRIVATE ${boost_assert_IDEFILES}) + file(GLOB_RECURSE boost_assert_HEADERS CONFIGURE_DEPENDS include/*.hpp) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HEADERS} PREFIX "Header Files") + target_sources(boost_assert PRIVATE ${boost_assert_HEADERS}) + unset(boost_assert_HEADERS) target_sources(boost_assert PUBLIC extra/boost_assert.natvis) From 297b489b58b36baabc27879d807c674fedc2b655 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 11:00:46 +0300 Subject: [PATCH 099/110] Remove the check for the Visual Studio generator; the generator may be Ninja on Windows, and adding the headers to the project may be useful on non-Windows --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f5f44..403fbe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ target_link_libraries(boost_assert # Add headers and .natvis to project, for better IDE integration -if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") +if(CMAKE_VERSION VERSION_GREATER 3.18) # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 @@ -28,7 +28,12 @@ if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio target_sources(boost_assert PRIVATE ${boost_assert_HEADERS}) unset(boost_assert_HEADERS) - target_sources(boost_assert PUBLIC extra/boost_assert.natvis) + if(MSVC) + + # Only Visual Studio needs this, but the generator may also be Ninja + target_sources(boost_assert PUBLIC extra/boost_assert.natvis) + + endif() endif() From 2cd62786c8c708c5a932f02354000e76128dccce Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 11:05:26 +0300 Subject: [PATCH 100/110] Update preferred CMake version to 3.31 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 403fbe4..7e095d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -# We support CMake 3.5, but prefer 3.20 policies and behavior -cmake_minimum_required(VERSION 3.5...3.20) +# We support CMake 3.5, but prefer 3.31 policies and behavior +cmake_minimum_required(VERSION 3.5...3.31) project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) From d20762a340dc7dc044a1d235475028b50370a288 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 11:40:59 +0300 Subject: [PATCH 101/110] Update source groups to match directory structure, in anticipation of an eventual switch to source_group(TREE) under CMake 3.28+ --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e095d8..2a45c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,14 +24,15 @@ if(CMAKE_VERSION VERSION_GREATER 3.18) # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 file(GLOB_RECURSE boost_assert_HEADERS CONFIGURE_DEPENDS include/*.hpp) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HEADERS} PREFIX "Header Files") target_sources(boost_assert PRIVATE ${boost_assert_HEADERS}) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HEADERS} PREFIX "include") unset(boost_assert_HEADERS) if(MSVC) # Only Visual Studio needs this, but the generator may also be Ninja target_sources(boost_assert PUBLIC extra/boost_assert.natvis) + source_group(TREE ${PROJECT_SOURCE_DIR}/extra FILES extra/boost_assert.natvis PREFIX "extra") endif() From d81367053fb1e9552e5c7d355c93b8b6926def6d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 11:50:12 +0300 Subject: [PATCH 102/110] Rename `boost_assert_HEADERS` variable to `headers`, to facilitate copy-paste into other libraries --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a45c60..79fa807 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,10 +23,10 @@ if(CMAKE_VERSION VERSION_GREATER 3.18) # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 - file(GLOB_RECURSE boost_assert_HEADERS CONFIGURE_DEPENDS include/*.hpp) - target_sources(boost_assert PRIVATE ${boost_assert_HEADERS}) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_assert_HEADERS} PREFIX "include") - unset(boost_assert_HEADERS) + file(GLOB_RECURSE headers CONFIGURE_DEPENDS include/*.hpp) + target_sources(boost_assert PRIVATE ${headers}) + source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${headers} PREFIX "include") + unset(headers) if(MSVC) From f97b82f0384f29c3e44e847907060dc60b53115c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 11:52:04 +0300 Subject: [PATCH 103/110] Quote directory in source_group --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79fa807..134b424 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,14 +25,14 @@ if(CMAKE_VERSION VERSION_GREATER 3.18) file(GLOB_RECURSE headers CONFIGURE_DEPENDS include/*.hpp) target_sources(boost_assert PRIVATE ${headers}) - source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${headers} PREFIX "include") + source_group(TREE "${PROJECT_SOURCE_DIR}/include" FILES ${headers} PREFIX "include") unset(headers) if(MSVC) # Only Visual Studio needs this, but the generator may also be Ninja target_sources(boost_assert PUBLIC extra/boost_assert.natvis) - source_group(TREE ${PROJECT_SOURCE_DIR}/extra FILES extra/boost_assert.natvis PREFIX "extra") + source_group(TREE "${PROJECT_SOURCE_DIR}/extra" FILES extra/boost_assert.natvis PREFIX "extra") endif() From ce4e8e54570bdd78d0909406646eca1ad89c5ccb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 12:09:08 +0300 Subject: [PATCH 104/110] Remove PREFIX from source_group calls --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 134b424..425a066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,14 +25,14 @@ if(CMAKE_VERSION VERSION_GREATER 3.18) file(GLOB_RECURSE headers CONFIGURE_DEPENDS include/*.hpp) target_sources(boost_assert PRIVATE ${headers}) - source_group(TREE "${PROJECT_SOURCE_DIR}/include" FILES ${headers} PREFIX "include") + source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${headers}) unset(headers) if(MSVC) # Only Visual Studio needs this, but the generator may also be Ninja target_sources(boost_assert PUBLIC extra/boost_assert.natvis) - source_group(TREE "${PROJECT_SOURCE_DIR}/extra" FILES extra/boost_assert.natvis PREFIX "extra") + source_group(TREE ${PROJECT_SOURCE_DIR} FILES extra/boost_assert.natvis) endif() From 966b9debd29c051a110a2ad78908119eb44472c9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 12:15:12 +0300 Subject: [PATCH 105/110] Use a single source_group call for all sources --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 425a066..cac8bd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,17 +25,21 @@ if(CMAKE_VERSION VERSION_GREATER 3.18) file(GLOB_RECURSE headers CONFIGURE_DEPENDS include/*.hpp) target_sources(boost_assert PRIVATE ${headers}) - source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${headers}) unset(headers) if(MSVC) # Only Visual Studio needs this, but the generator may also be Ninja target_sources(boost_assert PUBLIC extra/boost_assert.natvis) - source_group(TREE ${PROJECT_SOURCE_DIR} FILES extra/boost_assert.natvis) endif() + # Make IDE project folders match directory structure + + get_target_property(sources boost_assert SOURCES) + source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${sources}) + unset(sources) + endif() # BUILD_TESTING is the standard CTest variable that enables testing From e107bd7b556d72ef5273c17f4099198a28edaa4d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Oct 2025 13:59:23 +0300 Subject: [PATCH 106/110] Fix 3.19 version check --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cac8bd7..5b33422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ target_link_libraries(boost_assert # Add headers and .natvis to project, for better IDE integration -if(CMAKE_VERSION VERSION_GREATER 3.18) +if(NOT CMAKE_VERSION VERSION_LESS 3.19) # Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19 From b994f1eb52bebb22af72c5d3977ea6a4e4ceae16 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 22 Jan 2026 21:15:02 +0300 Subject: [PATCH 107/110] Remove dependencies on Boost.StaticAssert. Boost.StaticAssert has been merged into Boost.Config, so remove the dependency. --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 151d267..ed79645 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -71,7 +71,6 @@ install: - git submodule update --init libs/headers - git submodule update --init libs/config - git submodule update --init libs/core - - git submodule update --init libs/static_assert - git submodule update --init libs/throw_exception - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\assert\ - cmd /c bootstrap From 060d17fe367b7a4c352ea176015b7beb745244ff Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 23 Jan 2026 02:35:56 +0200 Subject: [PATCH 108/110] Update ci.yml --- .github/workflows/ci.yml | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1430270..1294803 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,11 @@ jobs: os: ubuntu-latest container: ubuntu:24.04 install: g++-14 + - toolset: gcc-15 + cxxstd: "03,11,14,17,20,23,2c" + os: ubuntu-latest + container: ubuntu:25.10 + install: g++-15 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" @@ -178,14 +183,20 @@ jobs: os: ubuntu-latest install: clang-20 - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-13 + compiler: clang++-21 + cxxstd: "03,11,14,17,20,23,2c" + container: ubuntu:25.10 + os: ubuntu-latest + install: clang-21 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-14 - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-15 + - toolset: clang + cxxstd: "03,11,14,17,20,23,2c" + os: macos-26 runs-on: ${{matrix.os}} @@ -263,9 +274,9 @@ jobs: addrmd: 32,64 os: windows-2022 - toolset: clang-win - cxxstd: "14,17,latest" + cxxstd: "14,17,20,latest" addrmd: 32,64 - os: windows-2022 + os: windows-2025 - toolset: gcc cxxstd: "03,11,14,17,2a" addrmd: 64 @@ -309,11 +320,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} @@ -357,11 +365,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} @@ -415,11 +420,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} From 258e25795a6ea2daeb7f6cfeae7bb44b7fcf76d5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 23 Jan 2026 05:15:26 +0200 Subject: [PATCH 109/110] Update .drone.jsonnet --- .drone.jsonnet | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index eedeca6..e5942e5 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -34,7 +34,6 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch 'set -e', 'uname -a', 'echo $DRONE_STAGE_MACHINE', - 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', ] + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + @@ -221,6 +220,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-14-multilib", ), + linux_pipeline( + "Linux 25.10 GCC 15 32/64", + "cppalliance/droneubuntu2510:1", + { TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c', ADDRMD: '32,64' }, + "g++-15-multilib", + ), + linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", @@ -355,24 +361,38 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 24.04 Clang 18 UBSAN", + "Linux 24.04 Clang 18", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, "clang-18", ), linux_pipeline( - "Linux 24.04 Clang 18 ASAN", + "Linux 24.04 Clang 19", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, "clang-18", ), linux_pipeline( - "Linux 24.10 Clang 19", - "cppalliance/droneubuntu2410:1", - { TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' }, - "clang-19", + "Linux 24.04 Clang 20 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + ubsan, + "clang-20", + ), + + linux_pipeline( + "Linux 24.04 Clang 20 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + asan, + "clang-20", + ), + + linux_pipeline( + "Linux 25.10 Clang 21", + "cppalliance/droneubuntu2510:1", + { TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' }, + "clang-21", ), macos_pipeline( @@ -420,4 +440,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "cppalliance/dronevs2022:1", { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, ), + + windows_pipeline( + "Windows VS2026 msvc-14.5", + "cppalliance/dronevs2026:1", + { TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' }, + ), ] From af15ced8d04907345a0211dab46557e085960eb7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 23 Jan 2026 05:53:01 +0200 Subject: [PATCH 110/110] Add back cxxstd=03 to .drone.jsonnet --- .drone.jsonnet | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index e5942e5..7795dcd 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -363,35 +363,35 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 24.04 Clang 18", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' }, "clang-18", ), linux_pipeline( "Linux 24.04 Clang 19", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' }, "clang-18", ), linux_pipeline( "Linux 24.04 Clang 20 UBSAN", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '03,11,14,17,20,2b' } + ubsan, "clang-20", ), linux_pipeline( "Linux 24.04 Clang 20 ASAN", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '03,11,14,17,20,2b' } + asan, "clang-20", ), linux_pipeline( "Linux 25.10 Clang 21", "cppalliance/droneubuntu2510:1", - { TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' }, + { TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '03,11,14,17,20,23,2c' }, "clang-21", ),