diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3d08049..4c50b99 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -124,6 +124,8 @@ boost_test(TYPE run SOURCES std_interop_test14.cpp) boost_test(TYPE run SOURCES ec_location_test3.cpp) boost_test(TYPE run SOURCES ec_location_test4.cpp) +boost_test(TYPE compile SOURCES constexpr_test2.cpp) + # result set(BOOST_TEST_COMPILE_FEATURES cxx_std_11) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4a59edb..3217ae0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -152,6 +152,8 @@ run std_interop_test14.cpp ; run ec_location_test3.cpp ; run ec_location_test4.cpp ; +compile constexpr_test2.cpp ; + # result import ../../config/checks/config : requires ; diff --git a/test/constexpr_test2.cpp b/test/constexpr_test2.cpp new file mode 100644 index 0000000..08d0ea7 --- /dev/null +++ b/test/constexpr_test2.cpp @@ -0,0 +1,26 @@ +// Copyright 2022 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include + +#if defined(BOOST_GCC) && BOOST_GCC >= 40700 && BOOST_GCC < 40800 + +BOOST_PRAGMA_MESSAGE("Skipping test, BOOST_GCC is 407xx") + +#else + +struct X +{ + boost::system::error_code ec; +}; + +X const& f() +{ + BOOST_STATIC_CONSTEXPR X x; + return x; +} + +#endif