diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ae44914..423f61c 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -82,3 +82,5 @@ run test_return_function.cpp return_function/14 : : : shared $(che run test_return_function.cpp return_function/14 : : : static $(check14) : return_function_static_14 ; run quick.cpp ; + +compile issue_42.cpp ; diff --git a/test/issue_42.cpp b/test/issue_42.cpp new file mode 100644 index 0000000..a698571 --- /dev/null +++ b/test/issue_42.cpp @@ -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 + +struct F +{ + int operator()( int x ) const { return -x; } +}; + +struct X +{ + boost::function f_; + explicit X( boost::function f ): f_( f ) {} +}; + +F f2; +X x( f2 ); // -Wuninitialized under GCC 12