mirror of
https://github.com/boostorg/function.git
synced 2026-01-29 07:32:15 +00:00
Compare commits
7 Commits
feature/up
...
feature/is
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53c084084d | ||
|
|
c225007399 | ||
|
|
4633220a9d | ||
|
|
16fca8368b | ||
|
|
4cf7c718b8 | ||
|
|
389f886bc3 | ||
|
|
5b4e2797a2 |
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -126,7 +126,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
@@ -194,7 +194,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -236,7 +236,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
@@ -282,7 +282,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
@@ -338,7 +338,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
|
|||||||
@@ -906,6 +906,10 @@ namespace boost {
|
|||||||
// This warning is technically correct, but we don't want to pay the price for initializing
|
// 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
|
// just to silence a warning: https://github.com/boostorg/function/issues/27
|
||||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
# 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
|
# endif
|
||||||
std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));
|
std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));
|
||||||
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
||||||
@@ -1004,6 +1008,10 @@ namespace boost {
|
|||||||
// This warning is technically correct, but we don't want to pay the price for initializing
|
// 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
|
// just to silence a warning: https://github.com/boostorg/function/issues/27
|
||||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
# 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
|
# endif
|
||||||
std::memcpy(this->functor.data, f.functor.data, sizeof(this->functor.data));
|
std::memcpy(this->functor.data, f.functor.data, sizeof(this->functor.data));
|
||||||
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
# if defined(BOOST_GCC) && (BOOST_GCC >= 40700)
|
||||||
|
|||||||
@@ -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 test_return_function.cpp return_function/<cxxstd>14 : : : <link>static $(check14) : return_function_static_14 ;
|
||||||
|
|
||||||
run quick.cpp ;
|
run quick.cpp ;
|
||||||
|
|
||||||
|
compile issue_42.cpp ;
|
||||||
|
|||||||
@@ -33,10 +33,8 @@ boost_add_subdir(typeof)
|
|||||||
|
|
||||||
boost_add_subdir(static_assert)
|
boost_add_subdir(static_assert)
|
||||||
boost_add_subdir(container_hash)
|
boost_add_subdir(container_hash)
|
||||||
boost_add_subdir(smart_ptr)
|
boost_add_subdir(describe)
|
||||||
boost_add_subdir(detail)
|
boost_add_subdir(mp11)
|
||||||
boost_add_subdir(move)
|
|
||||||
boost_add_subdir(predef)
|
|
||||||
|
|
||||||
# --target check
|
# --target check
|
||||||
|
|
||||||
|
|||||||
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
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/core/is_same.hpp>
|
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
@@ -27,14 +26,14 @@ int main()
|
|||||||
{
|
{
|
||||||
typedef boost::function<X(Y)> F1;
|
typedef boost::function<X(Y)> F1;
|
||||||
|
|
||||||
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::result_type, X> ));
|
BOOST_TEST_TRAIT_SAME(F1::result_type, X);
|
||||||
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::argument_type, Y> ));
|
BOOST_TEST_TRAIT_SAME(F1::argument_type, Y);
|
||||||
|
|
||||||
typedef boost::function<X(Y, Z)> F2;
|
typedef boost::function<X(Y, Z)> F2;
|
||||||
|
|
||||||
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::result_type, X> ));
|
BOOST_TEST_TRAIT_SAME(F2::result_type, X);
|
||||||
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::first_argument_type, Y> ));
|
BOOST_TEST_TRAIT_SAME(F2::first_argument_type, Y);
|
||||||
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::second_argument_type, Z> ));
|
BOOST_TEST_TRAIT_SAME(F2::second_argument_type, Z);
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user