Add constexpr_test2.cpp

This commit is contained in:
Peter Dimov
2022-08-21 19:13:12 +03:00
parent cc7c2f7ee4
commit 867f6d06d0
3 changed files with 30 additions and 0 deletions

View File

@ -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)

View File

@ -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 ;

26
test/constexpr_test2.cpp Normal file
View File

@ -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 <boost/system/error_code.hpp>
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#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