mirror of
https://github.com/boostorg/function.git
synced 2025-06-25 03:51:38 +02:00
Compare commits
8 Commits
boost-1.79
...
esp-idf-co
Author | SHA1 | Date | |
---|---|---|---|
e467a58fd6 | |||
16fca8368b | |||
4cf7c718b8 | |||
389f886bc3 | |||
abc1bf9b4a | |||
e665d1e9af | |||
f7e42dc08f | |||
5b4e2797a2 |
58
.github/workflows/ci.yml
vendored
58
.github/workflows/ci.yml
vendored
@ -20,33 +20,48 @@ jobs:
|
||||
- toolset: gcc-4.8
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-18.04
|
||||
install: g++-4.8
|
||||
install: g++-4.8-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-5
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
install: g++-5
|
||||
install: g++-5-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-6
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
install: g++-6
|
||||
install: g++-6-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
install: g++-7-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-8
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
install: g++-8
|
||||
install: g++-8-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-9-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-10
|
||||
install: g++-10-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-11
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-20.04
|
||||
install: g++-11
|
||||
install: g++-11-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: g++-12-multilib
|
||||
address-model: 32,64
|
||||
- toolset: clang
|
||||
compiler: clang++-3.9
|
||||
cxxstd: "03,11,14"
|
||||
@ -92,8 +107,18 @@ jobs:
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-12
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-13
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: clang-13
|
||||
- toolset: clang
|
||||
compiler: clang++-14
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: clang-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-10.15
|
||||
@ -137,7 +162,8 @@ jobs:
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd ../boost-root
|
||||
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
|
||||
export ADDRMD=${{matrix.address-model}}
|
||||
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
|
||||
|
||||
windows:
|
||||
strategy:
|
||||
@ -145,18 +171,18 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- toolset: msvc-14.0
|
||||
cxxstd: "14"
|
||||
cxxstd: 14,latest
|
||||
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
|
||||
@ -196,7 +222,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:
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
if(NOT DEFINED IDF_TARGET)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(boost_function VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
@ -32,3 +34,27 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
|
||||
|
||||
idf_component_register(
|
||||
SRCS
|
||||
${headers}
|
||||
INCLUDE_DIRS
|
||||
include
|
||||
REQUIRES
|
||||
boost_assert
|
||||
boost_bind
|
||||
boost_config
|
||||
boost_core
|
||||
boost_integer
|
||||
boost_preprocessor
|
||||
boost_throw_exception
|
||||
boost_type_index
|
||||
boost_type_traits
|
||||
boost_typeof
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
@ -906,6 +906,10 @@ namespace boost {
|
||||
// This warning is technically correct, but we don't want to pay the price for initializing
|
||||
// just to silence a warning: https://github.com/boostorg/function/issues/27
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
# if (BOOST_GCC >= 120000)
|
||||
// GCC 12 emits a different warning: https://github.com/boostorg/function/issues/42
|
||||
# pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
# endif
|
||||
# endif
|
||||
std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));
|
||||
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
||||
@ -1004,20 +1008,24 @@ namespace boost {
|
||||
// This warning is technically correct, but we don't want to pay the price for initializing
|
||||
// just to silence a warning: https://github.com/boostorg/function/issues/27
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
# if (BOOST_GCC >= 120000)
|
||||
// GCC 12 emits a different warning: https://github.com/boostorg/function/issues/42
|
||||
# pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
# endif
|
||||
# endif
|
||||
std::memcpy(this->functor.data, f.functor.data, sizeof(this->functor.data));
|
||||
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
} else
|
||||
#if defined(BOOST_GCC) && (__GNUC__ == 11)
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 11)
|
||||
# pragma GCC diagnostic push
|
||||
// False positive in GCC 11 for empty function objects (function_n_test.cpp:673)
|
||||
// False positive in GCC 11/12 for empty function objects (function_n_test.cpp:673)
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
get_vtable()->base.manager(f.functor, this->functor,
|
||||
boost::detail::function::move_functor_tag);
|
||||
#if defined(BOOST_GCC) && (__GNUC__ == 11)
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 11)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
f.vtable = 0;
|
||||
|
@ -82,3 +82,5 @@ run test_return_function.cpp return_function/<cxxstd>14 : : : <link>shared $(che
|
||||
run test_return_function.cpp return_function/<cxxstd>14 : : : <link>static $(check14) : return_function_static_14 ;
|
||||
|
||||
run quick.cpp ;
|
||||
|
||||
compile issue_42.cpp ;
|
||||
|
21
test/issue_42.cpp
Normal file
21
test/issue_42.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2022 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// https://github.com/boostorg/function/issues/42
|
||||
|
||||
#include <boost/function.hpp>
|
||||
|
||||
struct F
|
||||
{
|
||||
int operator()( int x ) const { return -x; }
|
||||
};
|
||||
|
||||
struct X
|
||||
{
|
||||
boost::function<int(int)> f_;
|
||||
explicit X( boost::function<int(int)> f ): f_( f ) {}
|
||||
};
|
||||
|
||||
F f2;
|
||||
X x( f2 ); // -Wuninitialized under GCC 12
|
@ -14,6 +14,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 12
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
@ -14,6 +14,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 12
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
Reference in New Issue
Block a user