diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index 6a5c2222..d27feb96 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 Fri Aug 15 15:51:00 2014 +# This file was automatically generated on Fri Aug 22 18:33:21 2014 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -305,6 +305,9 @@ explicit cxx11_hdr_unordered_set ; run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_INLINE_NAMESPACES : cxx11_inline_namespaces ; alias cxx11_inline_namespaces : cxx11_inline_namespaces.output ; explicit cxx11_inline_namespaces ; +run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS : cxx11_non_public_defaulted_functions ; +alias cxx11_non_public_defaulted_functions : cxx11_non_public_defaulted_functions.output ; +explicit cxx11_non_public_defaulted_functions ; run-simple test_case.cpp : : : TEST_BOOST_NO_CXX11_NUMERIC_LIMITS : cxx11_numeric_limits ; alias cxx11_numeric_limits : cxx11_numeric_limits.output ; explicit cxx11_numeric_limits ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index bc69319b..24e314b0 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Aug 15 15:51:00 2014 +// This file was automatically generated on Fri Aug 22 18:33:21 2014 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -381,6 +381,10 @@ namespace test = boost_no_cxx11_hdr_unordered_set; # include "../test/boost_no_cxx11_inline_namespaces.ipp" namespace test = boost_no_cxx11_inline_namespaces; #endif +#ifdef TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS +# include "../test/boost_no_cxx11_non_pub_def_fun.ipp" +namespace test = boost_no_cxx11_non_public_defaulted_functions; +#endif #ifdef TEST_BOOST_NO_CXX11_NUMERIC_LIMITS # include "../test/boost_no_cxx11_numeric_limits.ipp" namespace test = boost_no_cxx11_numeric_limits; diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 0d01d50d..0cbc7a76 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 Fri Aug 15 15:51:00 2014 +# This file was automatically generated on Fri Aug 22 18:33:21 2014 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -301,6 +301,9 @@ test-suite "BOOST_NO_CXX11_HDR_UNORDERED_SET" : test-suite "BOOST_NO_CXX11_INLINE_NAMESPACES" : [ run ../no_cxx11_inline_namespaces_pass.cpp ] [ compile-fail ../no_cxx11_inline_namespaces_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS" : +[ run ../no_cxx11_non_pub_def_fun_pass.cpp ] +[ compile-fail ../no_cxx11_non_pub_def_fun_fail.cpp ] ; test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : [ run ../no_cxx11_numeric_limits_pass.cpp ] [ compile-fail ../no_cxx11_numeric_limits_fail.cpp ] ; diff --git a/test/boost_no_cxx11_non_pub_def_fun.ipp b/test/boost_no_cxx11_non_pub_def_fun.ipp new file mode 100644 index 00000000..8089c751 --- /dev/null +++ b/test/boost_no_cxx11_non_pub_def_fun.ipp @@ -0,0 +1,38 @@ +// (C) Copyright Andrey Semashev 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_NON_PUBLIC_DEFAULTED_FUNCTIONS +// TITLE: C++11 non-public defaulted functions unavailable +// DESCRIPTION: The compiler does not support C++11 defaulted functions in access control sections other than public + +#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X) +# error Non-public defaulted functions are not supported in non-C++11 mode +#endif + +namespace boost_no_cxx11_non_public_defaulted_functions { + +struct foo +{ +protected: + foo() = default; + foo& operator= (foo const&) = default; +}; + +struct bar +{ +private: + bar() = default; + bar& operator= (bar const&) = default; +}; + +int test() +{ + return 0; +} + +} diff --git a/test/config_info.cpp b/test/config_info.cpp index cdf4f9f3..813b23c8 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1036,6 +1036,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_LAMBDAS); PRINT_MACRO(BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS); PRINT_MACRO(BOOST_NO_CXX11_NOEXCEPT); + 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_RANGE_BASED_FOR); @@ -1132,6 +1133,7 @@ void print_boost_macros() + // END GENERATED BLOCK diff --git a/test/config_test.cpp b/test/config_test.cpp index f2497cdd..68d1b40c 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Aug 15 15:51:00 2014 +// This file was automatically generated on Fri Aug 22 18:33:21 2014 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -227,6 +227,11 @@ namespace boost_no_cxx11_hdr_unordered_set = empty_boost; #else namespace boost_no_cxx11_inline_namespaces = empty_boost; #endif +#ifndef BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS +#include "boost_no_cxx11_non_pub_def_fun.ipp" +#else +namespace boost_no_cxx11_non_public_defaulted_functions = empty_boost; +#endif #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS #include "boost_no_cxx11_numeric_limits.ipp" #else @@ -1396,6 +1401,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_INLINE_NAMESPACES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_non_public_defaulted_functions::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_numeric_limits::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_non_pub_def_fun_fail.cpp b/test/no_cxx11_non_pub_def_fun_fail.cpp new file mode 100644 index 00000000..59f32b6c --- /dev/null +++ b/test/no_cxx11_non_pub_def_fun_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Aug 22 18:33:20 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_NON_PUBLIC_DEFAULTED_FUNCTIONS +// This file should not compile, if it does then +// BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS should not be defined. +// See file boost_no_cxx11_non_pub_def_fun.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_NON_PUBLIC_DEFAULTED_FUNCTIONS +#include "boost_no_cxx11_non_pub_def_fun.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_non_public_defaulted_functions::test(); +} + diff --git a/test/no_cxx11_non_pub_def_fun_pass.cpp b/test/no_cxx11_non_pub_def_fun_pass.cpp new file mode 100644 index 00000000..2e00a6a7 --- /dev/null +++ b/test/no_cxx11_non_pub_def_fun_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Aug 22 18:33:20 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_NON_PUBLIC_DEFAULTED_FUNCTIONS +// This file should compile, if it does not then +// BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS should be defined. +// See file boost_no_cxx11_non_pub_def_fun.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_NON_PUBLIC_DEFAULTED_FUNCTIONS +#include "boost_no_cxx11_non_pub_def_fun.ipp" +#else +namespace boost_no_cxx11_non_public_defaulted_functions = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_non_public_defaulted_functions::test(); +} +