From bdc7a9cfc52f59c2bc0a4345d3d9be0f5b5dc9bd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 9 Jul 2024 18:54:43 +0300 Subject: [PATCH 1/7] Update ci.yml --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaf406f..5a45bcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,8 +49,7 @@ jobs: install: g++-10 - toolset: gcc-11 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 - install: g++-11 + os: ubuntu-22.04 - toolset: gcc-12 cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 @@ -60,6 +59,11 @@ jobs: container: ubuntu:23.04 os: ubuntu-latest install: g++-13 + - toolset: gcc-14 + cxxstd: "11,14,17,20,2b" + container: ubuntu:24.04 + os: ubuntu-latest + install: g++-14 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" @@ -144,14 +148,20 @@ jobs: os: ubuntu-latest install: clang-17 - toolset: clang - cxxstd: "11,14,17,2a" - os: macos-11 + compiler: clang++-18 + cxxstd: "11,14,17,20,2b" + container: ubuntu:24.04 + os: ubuntu-latest + install: clang-18 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-12 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-13 + - toolset: clang + cxxstd: "11,14,17,20,2b" + os: macos-14 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -161,6 +171,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 @@ -236,7 +250,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -273,14 +287,14 @@ 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}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -321,14 +335,14 @@ 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}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -379,14 +393,14 @@ 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}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -439,7 +453,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -488,7 +502,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -555,7 +569,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd From 8729fbdbfa124291612bc011a7d639d8701de0c2 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 9 Jul 2024 19:41:04 +0300 Subject: [PATCH 2/7] Update GCC workaround in bind_dm3_test --- test/bind_dm3_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bind_dm3_test.cpp b/test/bind_dm3_test.cpp index 77f9897..3bd4a4e 100644 --- a/test/bind_dm3_test.cpp +++ b/test/bind_dm3_test.cpp @@ -17,7 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#if defined(BOOST_GCC) && BOOST_GCC >= 130000 && BOOST_GCC < 140000 +#if defined(BOOST_GCC) && BOOST_GCC >= 130000 && BOOST_GCC < 150000 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113256 # pragma GCC diagnostic ignored "-Wdangling-reference" #endif From b7edec730073ffc8f7c58cc8623a76f36db424cf Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 9 Jul 2024 20:03:52 +0300 Subject: [PATCH 3/7] Enable cdecl, stdcall, fastcall tests when _MSC_VER is defined, instead of just when BOOST_MSVC is defined. Refs #35. --- test/bind_cdecl_mf_test.cpp | 2 +- test/bind_fastcall_mf_test.cpp | 2 +- test/bind_fastcall_test.cpp | 2 +- test/bind_stdcall_mf_test.cpp | 2 +- test/bind_stdcall_test.cpp | 2 +- test/mem_fn_cdecl_ref_test.cpp | 2 +- test/mem_fn_cdecl_test.cpp | 2 +- test/mem_fn_fastcall_ref_test.cpp | 2 +- test/mem_fn_fastcall_test.cpp | 2 +- test/mem_fn_stdcall_ref_test.cpp | 2 +- test/mem_fn_stdcall_test.cpp | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/bind_cdecl_mf_test.cpp b/test/bind_cdecl_mf_test.cpp index 785e90d..756e882 100644 --- a/test/bind_cdecl_mf_test.cpp +++ b/test/bind_cdecl_mf_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/bind_fastcall_mf_test.cpp b/test/bind_fastcall_mf_test.cpp index 85406b9..9debc4b 100644 --- a/test/bind_fastcall_mf_test.cpp +++ b/test/bind_fastcall_mf_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/bind_fastcall_test.cpp b/test/bind_fastcall_test.cpp index fe49f28..4c88c25 100644 --- a/test/bind_fastcall_test.cpp +++ b/test/bind_fastcall_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/bind_stdcall_mf_test.cpp b/test/bind_stdcall_mf_test.cpp index f2bf971..4192e29 100644 --- a/test/bind_stdcall_mf_test.cpp +++ b/test/bind_stdcall_mf_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/bind_stdcall_test.cpp b/test/bind_stdcall_test.cpp index 2e6dc59..7acdb3e 100644 --- a/test/bind_stdcall_test.cpp +++ b/test/bind_stdcall_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_cdecl_ref_test.cpp b/test/mem_fn_cdecl_ref_test.cpp index 94ee948..0af0e30 100644 --- a/test/mem_fn_cdecl_ref_test.cpp +++ b/test/mem_fn_cdecl_ref_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_cdecl_test.cpp b/test/mem_fn_cdecl_test.cpp index ed5a47c..b53de35 100644 --- a/test/mem_fn_cdecl_test.cpp +++ b/test/mem_fn_cdecl_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_fastcall_ref_test.cpp b/test/mem_fn_fastcall_ref_test.cpp index 3319d94..0f27e3e 100644 --- a/test/mem_fn_fastcall_ref_test.cpp +++ b/test/mem_fn_fastcall_ref_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_fastcall_test.cpp b/test/mem_fn_fastcall_test.cpp index b7a6ab3..f4fb06b 100644 --- a/test/mem_fn_fastcall_test.cpp +++ b/test/mem_fn_fastcall_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_stdcall_ref_test.cpp b/test/mem_fn_stdcall_ref_test.cpp index 38e69fd..a8b0c82 100644 --- a/test/mem_fn_stdcall_ref_test.cpp +++ b/test/mem_fn_stdcall_ref_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { diff --git a/test/mem_fn_stdcall_test.cpp b/test/mem_fn_stdcall_test.cpp index 7f5645f..6c8eaea 100644 --- a/test/mem_fn_stdcall_test.cpp +++ b/test/mem_fn_stdcall_test.cpp @@ -1,6 +1,6 @@ #include -#ifndef BOOST_MSVC +#ifndef _MSC_VER int main() { From cb724dcf57508f3d42b73a3a86cbdfcb32c3159b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 9 Jul 2024 20:07:25 +0300 Subject: [PATCH 4/7] Remove obsolete warning suppression --- test/mem_fn_cdecl_test.cpp | 10 ---------- test/mem_fn_derived_test.cpp | 10 ---------- test/mem_fn_fastcall_test.cpp | 10 ---------- test/mem_fn_rv_test.cpp | 9 --------- test/mem_fn_stdcall_test.cpp | 10 ---------- test/mem_fn_test.cpp | 10 ---------- test/mem_fn_void_test.cpp | 10 ---------- 7 files changed, 69 deletions(-) diff --git a/test/mem_fn_cdecl_test.cpp b/test/mem_fn_cdecl_test.cpp index b53de35..7aec244 100644 --- a/test/mem_fn_cdecl_test.cpp +++ b/test/mem_fn_cdecl_test.cpp @@ -29,18 +29,8 @@ int main() #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct X { mutable unsigned int hash; diff --git a/test/mem_fn_derived_test.cpp b/test/mem_fn_derived_test.cpp index f8aa0e9..8a16a52 100644 --- a/test/mem_fn_derived_test.cpp +++ b/test/mem_fn_derived_test.cpp @@ -19,18 +19,8 @@ #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct B { mutable unsigned int hash; diff --git a/test/mem_fn_fastcall_test.cpp b/test/mem_fn_fastcall_test.cpp index f4fb06b..b65d417 100644 --- a/test/mem_fn_fastcall_test.cpp +++ b/test/mem_fn_fastcall_test.cpp @@ -29,18 +29,8 @@ int main() #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct X { mutable unsigned int hash; diff --git a/test/mem_fn_rv_test.cpp b/test/mem_fn_rv_test.cpp index 4147105..34b7f33 100644 --- a/test/mem_fn_rv_test.cpp +++ b/test/mem_fn_rv_test.cpp @@ -20,17 +20,8 @@ #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - unsigned int hash = 0; struct X diff --git a/test/mem_fn_stdcall_test.cpp b/test/mem_fn_stdcall_test.cpp index 6c8eaea..4f20c10 100644 --- a/test/mem_fn_stdcall_test.cpp +++ b/test/mem_fn_stdcall_test.cpp @@ -29,18 +29,8 @@ int main() #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct X { mutable unsigned int hash; diff --git a/test/mem_fn_test.cpp b/test/mem_fn_test.cpp index 960a828..1e6565d 100644 --- a/test/mem_fn_test.cpp +++ b/test/mem_fn_test.cpp @@ -19,18 +19,8 @@ #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct X { mutable unsigned int hash; diff --git a/test/mem_fn_void_test.cpp b/test/mem_fn_void_test.cpp index 9f52ccf..a1fee64 100644 --- a/test/mem_fn_void_test.cpp +++ b/test/mem_fn_void_test.cpp @@ -19,18 +19,8 @@ #include #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(push, 3) -#endif - #include -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -#pragma warning(pop) -#endif - - struct X { mutable unsigned int hash; From 769479a9640c5f8e42e417c1192cdb0f324202b1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 9 Jul 2024 20:24:19 +0300 Subject: [PATCH 5/7] Refactor _bi::dm_result<> to not form references to functions. Fixes #35. --- include/boost/bind/bind.hpp | 52 +++++++++++-------------------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/include/boost/bind/bind.hpp b/include/boost/bind/bind.hpp index 2d5b454..5ec7923 100644 --- a/include/boost/bind/bind.hpp +++ b/include/boost/bind/bind.hpp @@ -737,44 +737,18 @@ template namespace _bi { -template< class Pm, int I > struct add_cref; +template struct add_cref; -template< class M, class T > struct add_cref< M T::*, 0 > +template struct add_cref { typedef M type; }; -template< class M, class T > struct add_cref< M T::*, 1 > +template struct add_cref { -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable:4180) -#endif - typedef M const & type; -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif + typedef M const& type; }; -template< class R, class T > struct add_cref< R (T::*) (), 1 > -{ - typedef void type; -}; - -template< class R, class T > struct add_cref< R (T::*) () const, 1 > -{ - typedef void type; -}; - -#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) - -template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 > -{ - typedef void type; -}; - -#endif // __cpp_noexcept_function_type - template struct isref { enum value_type { value = 0 }; @@ -790,30 +764,34 @@ template struct isref< R* > enum value_type { value = 1 }; }; -template struct dm_result +template::value> struct dm_result { - typedef typename add_cref< Pm, 1 >::type type; }; -template struct dm_result< Pm, bind_t > +template struct dm_result +{ + typedef typename add_cref< M, 1 >::type type; +}; + +template struct dm_result, false> { typedef typename bind_t::result_type result_type; - typedef typename add_cref< Pm, isref< result_type >::value >::type type; + typedef typename add_cref< M, isref< result_type >::value >::type type; }; } // namespace _bi -template< class A1, class M, class T > +template _bi::bind_t< - typename _bi::dm_result< M T::*, A1 >::type, + typename _bi::dm_result::type, _mfi::dm, typename _bi::list_av::type > BOOST_BIND( M T::*f, A1 a1 ) { - typedef typename _bi::dm_result< M T::*, A1 >::type result_type; + typedef typename _bi::dm_result::type result_type; typedef _mfi::dm F; typedef typename _bi::list_av::type list_type; return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) ); From 76c1733f47c5cdb4ecf59b918018b8fb1976c362 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jul 2024 11:41:39 +0300 Subject: [PATCH 6/7] Update .drone.jsonnet --- .drone.jsonnet | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index c46e4cb..8a7b43b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -190,13 +190,6 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-13-multilib", ), - linux_pipeline( - "Linux 23.04 GCC 13 64 ASAN", - "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, - "g++-13-multilib", - ), - linux_pipeline( "Linux 23.04 GCC 13 32 UBSAN", "cppalliance/droneubuntu2304:1", @@ -211,6 +204,34 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-13-multilib", ), + linux_pipeline( + "Linux 24.04 GCC 14 32 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, + "g++-14-multilib", + ), + + linux_pipeline( + "Linux 24.04 GCC 14 64 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, + "g++-14-multilib", + ), + + linux_pipeline( + "Linux 24.04 GCC 14 32 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + ubsan, + "g++-14-multilib", + ), + + linux_pipeline( + "Linux 24.04 GCC 14 64 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + ubsan, + "g++-14-multilib", + ), + linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", @@ -281,6 +302,20 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "clang-17", ), + linux_pipeline( + "Linux 24.04 Clang 18 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '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: '11,14,17,20,2b' } + asan, + "clang-18", + ), + macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,1z' } + ubsan, From 97776ec7ba6217ecdfb8fd777dec85117de6f188 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jul 2024 12:38:24 +0300 Subject: [PATCH 7/7] Disable -Warray-bounds in bind_ref_test because of GCC 14 UBSAN --- test/bind_ref_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/bind_ref_test.cpp b/test/bind_ref_test.cpp index c90efca..d154afc 100644 --- a/test/bind_ref_test.cpp +++ b/test/bind_ref_test.cpp @@ -8,6 +8,13 @@ // http://www.boost.org/LICENSE_1_0.txt // +#if defined(__GNUC__) +// -Warray-bounds false positive under GCC 14 UBSAN +// ./boost/bind/mem_fn.hpp:74:59: error: array subscript 'int (**)(...)[0]' is partly outside array bounds of 'X [1]' [-Werror=array-bounds=] +// 74 | return (get_pointer( std::forward( u ) )->*pm_)( std::forward( a )... ); +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif + #include #include #include