Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / config / test / boost_no_cxx11_non_pub_def_fun.ipp
1 //  (C) Copyright Andrey Semashev 2014
2
3 //  Use, modification and distribution are subject to the
4 //  Boost Software License, Version 1.0. (See accompanying file
5 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 //  See http://www.boost.org/libs/config for more information.
8
9 //  MACRO:         BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
10 //  TITLE:         C++11 non-public defaulted functions unavailable
11 //  DESCRIPTION:   The compiler does not support C++11 defaulted functions in access control sections other than public
12
13 #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X)
14 #  error Non-public defaulted functions are not supported in non-C++11 mode
15 #endif
16
17 namespace boost_no_cxx11_non_public_defaulted_functions {
18
19 struct foo
20 {
21 protected:
22     foo() = default;
23     foo& operator= (foo const&) = default;
24 };
25
26 struct bar
27 {
28 private:
29     bar() = default;
30     bar& operator= (bar const&) = default;
31 };
32
33 int test()
34 {
35     return 0;
36 }
37
38 }