From c6817bf70e220fc0bbe908212ee4d5194dcfca75 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Thu, 9 Apr 2020 13:10:15 -0400 Subject: [PATCH] Implement BOOST_OVERRIDE --- checks/Jamfile.v2 | 1 + checks/test_case.cpp | 5 +++ doc/macro_reference.qbk | 6 +++ include/boost/config/compiler/borland.hpp | 1 + include/boost/config/compiler/clang.hpp | 1 + include/boost/config/compiler/codegear.hpp | 1 + include/boost/config/compiler/common_edg.hpp | 1 + include/boost/config/compiler/cray.hpp | 3 ++ include/boost/config/compiler/digitalmars.hpp | 1 + include/boost/config/compiler/gcc.hpp | 1 + include/boost/config/compiler/gcc_xml.hpp | 1 + include/boost/config/compiler/intel.hpp | 2 + include/boost/config/compiler/metrowerks.hpp | 1 + include/boost/config/compiler/mpw.hpp | 1 + include/boost/config/compiler/pathscale.hpp | 1 + include/boost/config/compiler/sunpro_cc.hpp | 1 + include/boost/config/compiler/vacpp.hpp | 1 + include/boost/config/compiler/visualc.hpp | 1 + include/boost/config/compiler/xlcpp.hpp | 1 + include/boost/config/compiler/xlcpp_zos.hpp | 1 + include/boost/config/detail/suffix.hpp | 6 +++ test/Jamfile.v2 | 1 + test/all/Jamfile.v2 | 5 ++- test/boost_no_cxx11_override.ipp | 32 ++++++++++++++++ test/boost_override_test.cpp | 19 ++++++++++ test/config_info.cpp | 2 + test/config_test.cpp | 12 +++++- test/no_cxx11_override_fail.cpp | 37 +++++++++++++++++++ test/no_cxx11_override_pass.cpp | 37 +++++++++++++++++++ 29 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 test/boost_no_cxx11_override.ipp create mode 100644 test/boost_override_test.cpp create mode 100644 test/no_cxx11_override_fail.cpp create mode 100644 test/no_cxx11_override_pass.cpp diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index 5c0c93a3..a602c4e4 100644 --- a/checks/Jamfile.v2 +++ b/checks/Jamfile.v2 @@ -93,6 +93,7 @@ obj cxx11_hdr_unordered_set : test_case.cpp : TEST_BOOST_NO_CXX11_HDR_UN obj cxx11_inline_namespaces : test_case.cpp : TEST_BOOST_NO_CXX11_INLINE_NAMESPACES ; obj cxx11_non_public_defaulted_functions : test_case.cpp : TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS ; obj cxx11_numeric_limits : test_case.cpp : TEST_BOOST_NO_CXX11_NUMERIC_LIMITS ; +obj cxx11_override : test_case.cpp : TEST_BOOST_NO_CXX11_OVERRIDE ; obj cxx11_pointer_traits : test_case.cpp : TEST_BOOST_NO_CXX11_POINTER_TRAITS ; obj cxx11_ref_qualifiers : test_case.cpp : TEST_BOOST_NO_CXX11_REF_QUALIFIERS ; obj cxx11_sfinae_expr : test_case.cpp : TEST_BOOST_NO_CXX11_SFINAE_EXPR ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index 69989254..fcc5b6ca 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -421,6 +421,11 @@ # error "Defect macro BOOST_NO_CXX11_NUMERIC_LIMITS is defined." # endif #endif +#ifdef TEST_BOOST_NO_CXX11_OVERRIDE +# ifdef BOOST_NO_CXX11_OVERRIDE +# error "Defect macro BOOST_NO_CXX11_OVERRIDE is defined." +# endif +#endif #ifdef TEST_BOOST_NO_CXX11_POINTER_TRAITS # ifdef BOOST_NO_CXX11_POINTER_TRAITS # error "Defect macro BOOST_NO_CXX11_POINTER_TRAITS is defined." diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 394d5d04..fcf4c21c 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -685,6 +685,8 @@ compilers implementing an early draft of the C++11 standard (in particular, inco [[`BOOST_NO_CXX11_NUMERIC_LIMITS`][The standard library `` header does not support the C++11 version of `numeric_limits`. ]] +[[`BOOST_NO_CXX11_OVERRIDE`][The compiler does not support `override`. +]] [[`BOOST_NO_CXX11_POINTER_TRAITS`][The standard library does not provide a C++11 version of `std::pointer_traits` in .]] [[`BOOST_NO_CXX11_RANGE_BASED_FOR`][The compiler does not support @@ -793,6 +795,10 @@ with: static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a; `` ]] +[[`BOOST_OVERRIDE`][ +If `BOOST_NO_CXX11_OVERRIDE` is not defined (i.e. C++11 compliant compilers), +expands to `override` keyword, otherwise expands to nothing. +]] [[`BOOST_STATIC_CONSTEXPR`][ This is a shortcut for `static BOOST_CONSTEXPR_OR_CONST`. For example, when defining const expr variables replace: `` diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index f0b0b20f..366cd904 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -198,6 +198,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 1a15f6b0..9d8ba7d7 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -250,6 +250,7 @@ #if !__has_feature(cxx_override_control) # define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_OVERRIDE #endif #if !__has_feature(cxx_unrestricted_unions) diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index 6e348afc..3dd71e7e 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -251,6 +251,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_DECLTYPE_N3276 #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index 1cb3c98e..6597cd2a 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -107,6 +107,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/cray.hpp b/include/boost/config/compiler/cray.hpp index 4c73e9ac..2f1e9e8e 100644 --- a/include/boost/config/compiler/cray.hpp +++ b/include/boost/config/compiler/cray.hpp @@ -201,6 +201,7 @@ #define BOOST_NO_CXX11_DELETED_FUNCTIONS #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_CXX11_LAMBDAS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS @@ -275,6 +276,7 @@ #undef BOOST_NO_CXX11_DELETED_FUNCTIONS #undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #undef BOOST_NO_CXX11_FINAL +#undef BOOST_NO_CXX11_OVERRIDE #undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS #undef BOOST_NO_CXX11_LAMBDAS #undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS @@ -346,6 +348,7 @@ #undef BOOST_NO_CXX11_CHAR32_T #undef BOOST_NO_CXX11_INLINE_NAMESPACES #undef BOOST_NO_CXX11_FINAL +#undef BOOST_NO_CXX11_OVERRIDE #undef BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS #undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_CXX11_SFINAE_EXPR // This is correct, even though '*_fail.cpp' test fails. diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index 82029f90..7641ee8a 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -83,6 +83,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index d6fbda0e..da1a4322 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -249,6 +249,7 @@ # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_USER_DEFINED_LITERALS # define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS +# define BOOST_NO_CXX11_OVERRIDE #endif // C++0x features in 4.8.n and later diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index 4d14b42a..fd6896a8 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -61,6 +61,7 @@ # define BOOST_NO_CXX11_INLINE_NAMESPACES # define BOOST_NO_CXX11_REF_QUALIFIERS # define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_OVERRIDE # define BOOST_NO_CXX11_THREAD_LOCAL # define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index 2247bc71..9a06d2fe 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -501,8 +501,10 @@ template<> struct assert_intrinsic_wchar_t {}; #endif // BOOST_NO_CXX11_FINAL +// BOOST_NO_CXX11_OVERRIDE #if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40700)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700)) # undef BOOST_NO_CXX11_FINAL +# undef BOOST_NO_CXX11_OVERRIDE #endif // BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/metrowerks.hpp b/include/boost/config/compiler/metrowerks.hpp index 2e6cf70b..32c1ca9a 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -126,6 +126,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp index 8d7e8c28..750d5884 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -75,6 +75,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index ec6bfd5e..683b0d31 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -88,6 +88,7 @@ # define BOOST_NO_CXX11_INLINE_NAMESPACES # define BOOST_NO_CXX11_REF_QUALIFIERS # define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_OVERRIDE # define BOOST_NO_CXX11_THREAD_LOCAL # define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index 7d838fc9..c674e8ab 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -123,6 +123,7 @@ #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_UNRESTRICTED_UNION #endif diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index 2c4e2c96..0280fe29 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -137,6 +137,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 4c47b120..7335540d 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -144,6 +144,7 @@ # define BOOST_NO_CXX11_FINAL # define BOOST_NO_CXX11_RANGE_BASED_FOR # define BOOST_NO_CXX11_SCOPED_ENUMS +# define BOOST_NO_CXX11_OVERRIDE #endif // _MSC_VER < 1700 // C++11 features supported by VC++ 12 (aka 2013). diff --git a/include/boost/config/compiler/xlcpp.hpp b/include/boost/config/compiler/xlcpp.hpp index 95f5e1d9..c24b2c51 100644 --- a/include/boost/config/compiler/xlcpp.hpp +++ b/include/boost/config/compiler/xlcpp.hpp @@ -194,6 +194,7 @@ #if !__has_feature(cxx_override_control) # define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_OVERRIDE #endif #if !__has_feature(cxx_unrestricted_unions) diff --git a/include/boost/config/compiler/xlcpp_zos.hpp b/include/boost/config/compiler/xlcpp_zos.hpp index b62bd9a7..bc5b7e83 100644 --- a/include/boost/config/compiler/xlcpp_zos.hpp +++ b/include/boost/config/compiler/xlcpp_zos.hpp @@ -140,6 +140,7 @@ #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_OVERRIDE #define BOOST_NO_CXX11_ALIGNAS #define BOOST_NO_CXX11_UNRESTRICTED_UNION #define BOOST_NO_CXX14_VARIABLE_TEMPLATES diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index ffe39cfe..9fcde0cd 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -667,6 +667,12 @@ namespace std{ using ::type_info; } # define BOOST_UNLIKELY(x) x #endif +#if !defined(BOOST_NO_CXX11_OVERRIDE) +# define BOOST_OVERRIDE override +#else +# define BOOST_OVERRIDE +#endif + // Type and data alignment specification // #if !defined(BOOST_ALIGNMENT) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index afe06f04..2f4c974e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -110,6 +110,7 @@ test-suite config [ run helper_macros_test.cpp ] [ compile pragma_message_test.cpp ] [ compile header_deprecated_test.cpp ] + [ compile boost_override_test.cpp ] ; obj has_clang_implicit_fallthrough : cmd_line_check.cpp : diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index f804b20b..3b769522 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Mon Dec 09 09:47:37 2019 +# This file was automatically generated on Thu Apr 9 14:27:07 2020 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -268,6 +268,9 @@ test-suite "BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS" : test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : [ run ../no_cxx11_numeric_limits_pass.cpp ] [ compile-fail ../no_cxx11_numeric_limits_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_OVERRIDE" : +[ run ../no_cxx11_override_pass.cpp ] +[ compile-fail ../no_cxx11_override_fail.cpp ] ; test-suite "BOOST_NO_CXX11_POINTER_TRAITS" : [ run ../no_cxx11_pointer_traits_pass.cpp ] [ compile-fail ../no_cxx11_pointer_traits_fail.cpp ] ; diff --git a/test/boost_no_cxx11_override.ipp b/test/boost_no_cxx11_override.ipp new file mode 100644 index 00000000..20bfed08 --- /dev/null +++ b/test/boost_no_cxx11_override.ipp @@ -0,0 +1,32 @@ +/* +Copyright 2020 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +// MACRO: BOOST_NO_CXX11_OVERRIDE +// TITLE: C++11 SFINAE for expressions +// DESCRIPTION: C++11 SFINAE for expressions not supported. + +namespace boost_no_cxx11_override { + +struct base { + virtual void first() = 0; + virtual void second() { } +}; + +struct derived + : base { + void first() override { } + void second() override { } +}; + +int test() +{ + return 0; +} + +} /* boost_no_cxx11_override */ diff --git a/test/boost_override_test.cpp b/test/boost_override_test.cpp new file mode 100644 index 00000000..bb639018 --- /dev/null +++ b/test/boost_override_test.cpp @@ -0,0 +1,19 @@ +/* +Copyright 2020 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#include + +struct base { + virtual void first() = 0; + virtual void second() { } +}; + +struct derived + : base { + void first() BOOST_OVERRIDE { } + void second() BOOST_OVERRIDE { } +}; diff --git a/test/config_info.cpp b/test/config_info.cpp index 3a0c19ee..38ce96bd 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1131,6 +1131,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS); PRINT_MACRO(BOOST_NO_CXX11_NULLPTR); PRINT_MACRO(BOOST_NO_CXX11_NUMERIC_LIMITS); + PRINT_MACRO(BOOST_NO_CXX11_OVERRIDE); PRINT_MACRO(BOOST_NO_CXX11_POINTER_TRAITS); PRINT_MACRO(BOOST_NO_CXX11_RANGE_BASED_FOR); PRINT_MACRO(BOOST_NO_CXX11_RAW_LITERALS); @@ -1234,6 +1235,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_VOID_RETURNS); + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index f5c1137e..d1c92025 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon Dec 09 09:47:37 2019 +// This file was automatically generated on Thu Apr 9 14:27:07 2020 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -247,6 +247,11 @@ namespace boost_no_cxx11_non_public_defaulted_functions = empty_boost; #else namespace boost_no_cxx11_numeric_limits = empty_boost; #endif +#ifndef BOOST_NO_CXX11_OVERRIDE +#include "boost_no_cxx11_override.ipp" +#else +namespace boost_no_cxx11_override = empty_boost; +#endif #ifndef BOOST_NO_CXX11_POINTER_TRAITS #include "boost_no_cxx11_pointer_traits.ipp" #else @@ -1431,6 +1436,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_override::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_OVERRIDE at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_pointer_traits::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_POINTER_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_override_fail.cpp b/test/no_cxx11_override_fail.cpp new file mode 100644 index 00000000..494df796 --- /dev/null +++ b/test/no_cxx11_override_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Thu Apr 9 14:27:07 2020 +// 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_CXX11_OVERRIDE +// This file should not compile, if it does then +// BOOST_NO_CXX11_OVERRIDE should not be defined. +// See file boost_no_cxx11_override.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_CXX11_OVERRIDE +#include "boost_no_cxx11_override.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_override::test(); +} + diff --git a/test/no_cxx11_override_pass.cpp b/test/no_cxx11_override_pass.cpp new file mode 100644 index 00000000..4faee3bd --- /dev/null +++ b/test/no_cxx11_override_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Thu Apr 9 14:27:07 2020 +// 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_CXX11_OVERRIDE +// This file should compile, if it does not then +// BOOST_NO_CXX11_OVERRIDE should be defined. +// See file boost_no_cxx11_override.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_CXX11_OVERRIDE +#include "boost_no_cxx11_override.ipp" +#else +namespace boost_no_cxx11_override = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_override::test(); +} +