From f0136c59111cd07aec0d965ed6f42ad060be5adb Mon Sep 17 00:00:00 2001 From: K-ballo Date: Fri, 15 Aug 2014 16:04:42 -0300 Subject: [PATCH] Added macro BOOST_NO_CXX11_FINAL --- checks/Jamfile.v2 | 5 ++- checks/test_case.cpp | 6 ++- .../boost_config/boost_macro_reference.html | 12 ++++++ doc/html/index.html | 2 +- doc/macro_reference.qbk | 2 + include/boost/config/compiler/gcc.hpp | 1 + include/boost/config/compiler/visualc.hpp | 1 + test/all/Jamfile.v2 | 5 ++- test/boost_no_cxx11_final.ipp | 22 +++++++++++ test/config_info.cpp | 2 + test/config_test.cpp | 12 +++++- test/no_cxx11_final_fail.cpp | 37 +++++++++++++++++++ test/no_cxx11_final_pass.cpp | 37 +++++++++++++++++++ 13 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 test/boost_no_cxx11_final.ipp create mode 100644 test/no_cxx11_final_fail.cpp create mode 100644 test/no_cxx11_final_pass.cpp diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index bf5501c1..6a5c2222 100644 --- a/checks/Jamfile.v2 +++ b/checks/Jamfile.v2 @@ -1,6 +1,6 @@ # # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Thu Jun 12 13:21:03 2014 +# This file was automatically generated on Fri Aug 15 15:51:00 2014 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -242,6 +242,9 @@ explicit cxx11_allocator ; run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_ATOMIC_SMART_PTR : cxx11_atomic_smart_ptr ; alias cxx11_atomic_smart_ptr : cxx11_atomic_smart_ptr.output ; explicit cxx11_atomic_smart_ptr ; +run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_FINAL : cxx11_final ; +alias cxx11_final : cxx11_final.output ; +explicit cxx11_final ; run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_HDR_ARRAY : cxx11_hdr_array ; alias cxx11_hdr_array : cxx11_hdr_array.output ; explicit cxx11_hdr_array ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index d003f39c..bc69319b 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Thu Jun 12 13:21:03 2014 +// This file was automatically generated on Fri Aug 15 15:51:00 2014 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -297,6 +297,10 @@ namespace test = boost_no_cxx11_allocator; # include "../test/boost_no_cxx11_atomic_sp.ipp" namespace test = boost_no_cxx11_atomic_smart_ptr; #endif +#ifdef TEST_BOOST_NO_CXX11_FINAL +# include "../test/boost_no_cxx11_final.ipp" +namespace test = boost_no_cxx11_final; +#endif #ifdef TEST_BOOST_NO_CXX11_HDR_ARRAY # include "../test/boost_no_cxx11_hdr_array.ipp" namespace test = boost_no_cxx11_hdr_array; diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 7c553b61..5956e446 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -2863,6 +2863,18 @@ + +

+ BOOST_NO_CXX11_FINAL +

+ + +

+ The compiler does not support the C++ class-virt-specifier final. +

+ + +

BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS diff --git a/doc/html/index.html b/doc/html/index.html index 23664634..67510527 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -968,7 +968,7 @@ - +

Last revised: June 12, 2014 at 12:31:43 GMT

Last revised: August 15, 2014 at 19:00:47 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 639093ac..9e5a45d8 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -642,6 +642,8 @@ explicit conversion operators (`explicit operator T()`). [[`BOOST_NO_CXX11_EXTERN_TEMPLATE`][The compiler does not support explicit instantiation forward declarations for templates (`extern template ...`). ]] +[[`BOOST_NO_CXX11_FINAL`][The compiler does not support the C++ class-virt-specifier final. +]] [[`BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS`][The compiler does not support default template arguments for function templates. ]] diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index ef6b07e2..b0a7d2e9 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -218,6 +218,7 @@ // C++0x features in 4.7.n and later // #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_NO_CXX11_FINAL # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_USER_DEFINED_LITERALS #endif diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 6245a051..647e63ea 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -149,6 +149,7 @@ // C++11 features supported by VC++ 11 (aka 2012) // #if _MSC_VER < 1700 +# define BOOST_NO_CXX11_FINAL # define BOOST_NO_CXX11_RANGE_BASED_FOR # define BOOST_NO_CXX11_SCOPED_ENUMS #endif // _MSC_VER < 1700 diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 3f5ba1ae..0d01d50d 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 Thu Jun 12 13:21:03 2014 +# This file was automatically generated on Fri Aug 15 15:51:00 2014 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -238,6 +238,9 @@ test-suite "BOOST_NO_CXX11_ALLOCATOR" : test-suite "BOOST_NO_CXX11_ATOMIC_SMART_PTR" : [ run ../no_cxx11_atomic_sp_pass.cpp ] [ compile-fail ../no_cxx11_atomic_sp_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_FINAL" : +[ run ../no_cxx11_final_pass.cpp ] +[ compile-fail ../no_cxx11_final_fail.cpp ] ; test-suite "BOOST_NO_CXX11_HDR_ARRAY" : [ run ../no_cxx11_hdr_array_pass.cpp ] [ compile-fail ../no_cxx11_hdr_array_fail.cpp ] ; diff --git a/test/boost_no_cxx11_final.ipp b/test/boost_no_cxx11_final.ipp new file mode 100644 index 00000000..1baf66a4 --- /dev/null +++ b/test/boost_no_cxx11_final.ipp @@ -0,0 +1,22 @@ +// (C) Copyright Agustin Berge 2014 + +// 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_CXX11_FINAL +// TITLE: C++11 final class-virt-specifier +// DESCRIPTION: The compiler does not support the C++ class-virt-specifier final + +namespace boost_no_cxx11_final { + +struct X final {}; + +int test() +{ + return 0; +} + +} diff --git a/test/config_info.cpp b/test/config_info.cpp index d780fcab..cdf4f9f3 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1010,6 +1010,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_DELETED_FUNCTIONS); PRINT_MACRO(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS); PRINT_MACRO(BOOST_NO_CXX11_EXTERN_TEMPLATE); + PRINT_MACRO(BOOST_NO_CXX11_FINAL); PRINT_MACRO(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS); PRINT_MACRO(BOOST_NO_CXX11_HDR_ARRAY); PRINT_MACRO(BOOST_NO_CXX11_HDR_ATOMIC); @@ -1130,6 +1131,7 @@ void print_boost_macros() + // END GENERATED BLOCK diff --git a/test/config_test.cpp b/test/config_test.cpp index 3199d2be..f2497cdd 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Thu Jun 12 13:21:03 2014 +// This file was automatically generated on Fri Aug 15 15:51:00 2014 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -122,6 +122,11 @@ namespace boost_no_cxx11_allocator = empty_boost; #else namespace boost_no_cxx11_atomic_smart_ptr = empty_boost; #endif +#ifndef BOOST_NO_CXX11_FINAL +#include "boost_no_cxx11_final.ipp" +#else +namespace boost_no_cxx11_final = empty_boost; +#endif #ifndef BOOST_NO_CXX11_HDR_ARRAY #include "boost_no_cxx11_hdr_array.ipp" #else @@ -1286,6 +1291,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_ATOMIC_SMART_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_final::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_FINAL at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_hdr_array::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_HDR_ARRAY at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_final_fail.cpp b/test/no_cxx11_final_fail.cpp new file mode 100644 index 00000000..50c35a20 --- /dev/null +++ b/test/no_cxx11_final_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Aug 15 15:51:00 2014 +// 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_FINAL +// This file should not compile, if it does then +// BOOST_NO_CXX11_FINAL should not be defined. +// See file boost_no_cxx11_final.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_FINAL +#include "boost_no_cxx11_final.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_final::test(); +} + diff --git a/test/no_cxx11_final_pass.cpp b/test/no_cxx11_final_pass.cpp new file mode 100644 index 00000000..e18530bd --- /dev/null +++ b/test/no_cxx11_final_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Aug 15 15:51:00 2014 +// 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_FINAL +// This file should compile, if it does not then +// BOOST_NO_CXX11_FINAL should be defined. +// See file boost_no_cxx11_final.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_FINAL +#include "boost_no_cxx11_final.ipp" +#else +namespace boost_no_cxx11_final = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_final::test(); +} +