From ede243c42f299df4d0a08a13e1b3c5684890df2b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 26 Jul 2022 21:35:33 +0300 Subject: [PATCH] Add (negative) tests for default constructability (refs #86) --- test/result_default_construct.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/result_default_construct.cpp b/test/result_default_construct.cpp index 525976b..fe8e522 100644 --- a/test/result_default_construct.cpp +++ b/test/result_default_construct.cpp @@ -12,6 +12,11 @@ struct X { }; +struct Y +{ + Y( int ); +}; + int main() { { @@ -37,5 +42,17 @@ int main() BOOST_TEST( !r.has_error() ); } + { + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_TRUE((std::is_default_constructible>)); + + BOOST_TEST_TRAIT_FALSE((std::is_default_constructible>)); + BOOST_TEST_TRAIT_FALSE((std::is_default_constructible>)); + } + return boost::report_errors(); }