]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/contract/test/specify/auto_pre_error.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / contract / test / specify / auto_pre_error.cpp
1
2 // Copyright (C) 2008-2018 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0 (see accompanying
4 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
6
7 // Test auto error after pre (for free func, but same for all contracts).
8
9 #include <boost/config.hpp>
10 // Not just __cplusplus to detect C++17 as MSVC defines it correctly sometimes.
11 #if (defined(__cplusplus) && __cplusplus >= 201703L) || \
12 !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
13 #error "C++17 copy elision invalidates test so forcing expected failure"
14 #else
15
16 #include <boost/contract/function.hpp>
17
18 int main() {
19 auto c = boost::contract::function() // Error (can't use auto).
20 .precondition([] {})
21 ;
22 return 0;
23 }
24
25 #endif
26