diff --git a/test/boost_no_cxx17_hdr_variant.ipp b/test/boost_no_cxx17_hdr_variant.ipp new file mode 100644 index 00000000..a23ac2d7 --- /dev/null +++ b/test/boost_no_cxx17_hdr_variant.ipp @@ -0,0 +1,32 @@ +// (C) Copyright John Maddock 2019 + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for more information. + +// MACRO: BOOST_NO_CXX17_HDR_VARIANT +// TITLE: C++17 header unavailable +// DESCRIPTION: The standard library does not supply C++17 header + +#include + +namespace boost_no_cxx17_hdr_variant { + +int test() +{ + using std::variant; + using std::visit; + using std::holds_alternative; + using std::get; + using std::get_if; + using std::monostate; + using std::bad_variant_access; + using std::variant_size; + using std::variant_alternative; + using std::variant_npos; + return 0; +} + +} diff --git a/test/no_cxx17_hdr_variant_fail.cpp b/test/no_cxx17_hdr_variant_fail.cpp new file mode 100644 index 00000000..46cfe2e8 --- /dev/null +++ b/test/no_cxx17_hdr_variant_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon Apr 1 19:04:04 2019 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX17_HDR_VARIANT +// This file should not compile, if it does then +// BOOST_NO_CXX17_HDR_VARIANT should not be defined. +// See file boost_no_cxx17_hdr_variant.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX17_HDR_VARIANT +#include "boost_no_cxx17_hdr_variant.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_hdr_variant::test(); +} + diff --git a/test/no_cxx17_hdr_variant_pass.cpp b/test/no_cxx17_hdr_variant_pass.cpp new file mode 100644 index 00000000..13f4de73 --- /dev/null +++ b/test/no_cxx17_hdr_variant_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon Apr 1 19:04:04 2019 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX17_HDR_VARIANT +// This file should compile, if it does not then +// BOOST_NO_CXX17_HDR_VARIANT should be defined. +// See file boost_no_cxx17_hdr_variant.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX17_HDR_VARIANT +#include "boost_no_cxx17_hdr_variant.ipp" +#else +namespace boost_no_cxx17_hdr_variant = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_hdr_variant::test(); +} +