1 /*<-
2 Copyright (c) 2016 Barrett Adair
3 
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
6 ->*/
7 
8 #include <boost/callable_traits/detail/config.hpp>
9 
10 #include <boost/callable_traits/is_noexcept.hpp>
11 #include "test.hpp"
12 
13 template<typename Noexcept, typename NotNoexcept>
test()14 void test() {
15 
16     CT_ASSERT( is_noexcept<Noexcept>::value
17         // for old compilers, TEST_NOEXCEPT_QUAL is empty so types are same
18         || std::is_same<Noexcept, NotNoexcept>::value);
19 
20     CT_ASSERT(! is_noexcept<NotNoexcept>::value);
21 }
22 
23 #define TEST_NOEXCEPT(not_noexcept) test<not_noexcept BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER, not_noexcept>()
24 
main()25 int main() {
26 
27     TEST_NOEXCEPT(int(*)());
28 
29     #ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
30     TEST_NOEXCEPT(int() const);
31     TEST_NOEXCEPT(int(...) volatile LREF);
32     #endif
33 
34     TEST_NOEXCEPT(int(*)(...));
35 
36     struct foo;
37 
38     TEST_NOEXCEPT(int(foo::*)());
39     TEST_NOEXCEPT(int(foo::*)() const volatile);
40     TEST_NOEXCEPT(int(foo::*)(...));
41     TEST_NOEXCEPT(int(foo::*)(...) const volatile RREF);
42 }
43 
44