forked from boostorg/config
Added a test for BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS.
This commit is contained in:
1073
checks/Jamfile.v2
1073
checks/Jamfile.v2
File diff suppressed because it is too large
Load Diff
1354
checks/test_case.cpp
1354
checks/test_case.cpp
File diff suppressed because it is too large
Load Diff
1073
test/all/Jamfile.v2
1073
test/all/Jamfile.v2
File diff suppressed because it is too large
Load Diff
38
test/boost_no_non_public_defaulted_functions.ipp
Normal file
38
test/boost_no_non_public_defaulted_functions.ipp
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -1007,6 +1007,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_CXX11_DECLTYPE);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_DECLTYPE_N3276);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_DELETED_FUNCTIONS);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_EXTERN_TEMPLATE);
|
||||
@ -1132,6 +1133,7 @@ void print_boost_macros()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
3366
test/config_test.cpp
3366
test/config_test.cpp
File diff suppressed because it is too large
Load Diff
37
test/no_non_public_defaulted_functions_fail.cpp
Normal file
37
test/no_non_public_defaulted_functions_fail.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Thu Aug 21 15:59:10 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_non_public_defaulted_functions.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 <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
|
||||
#include "boost_no_non_public_defaulted_functions.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx11_non_public_defaulted_functions::test();
|
||||
}
|
||||
|
37
test/no_non_public_defaulted_functions_pass.cpp
Normal file
37
test/no_non_public_defaulted_functions_pass.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Thu Aug 21 15:59:10 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_non_public_defaulted_functions.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 <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
|
||||
#include "boost_no_non_public_defaulted_functions.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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user