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, 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 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 ) ); 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_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 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_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 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..7aec244 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() { @@ -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_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..b65d417 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() { @@ -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_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..4f20c10 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() { @@ -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;