1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03 |
10 | // REQUIRES: has-fblocks |
11 | // ADDITIONAL_COMPILE_FLAGS: -fblocks |
12 | |
13 | // <type_traits> |
14 | |
15 | // std::is_scalar |
16 | |
17 | // Make sure we report that blocks are scalar types. |
18 | |
19 | #include <type_traits> |
20 | |
21 | struct Foo { }; |
22 | template <int> struct Arg { }; |
23 | |
24 | static_assert(std::is_scalar<void (^)(void)>::value, "" ); |
25 | static_assert(std::is_scalar<void (^)()>::value, "" ); |
26 | static_assert(std::is_scalar<void (^)(Arg<0>)>::value, "" ); |
27 | static_assert(std::is_scalar<void (^)(Arg<0>, Arg<1>)>::value, "" ); |
28 | static_assert(std::is_scalar<void (^)(Arg<0>, Arg<1>, Arg<2>)>::value, "" ); |
29 | static_assert(std::is_scalar<Foo (^)(void)>::value, "" ); |
30 | static_assert(std::is_scalar<Foo (^)()>::value, "" ); |
31 | static_assert(std::is_scalar<Foo (^)(Arg<0>)>::value, "" ); |
32 | static_assert(std::is_scalar<Foo (^)(Arg<0>, Arg<1>)>::value, "" ); |
33 | static_assert(std::is_scalar<Foo (^)(Arg<0>, Arg<1>, Arg<2>)>::value, "" ); |
34 | |
35 | |
36 | int main(int, char**) { |
37 | return 0; |
38 | } |
39 | |