Debian Codegraph @

gcc/testsuite/g++.dg/ext/is_constructible8.C

raw
1 // PR c++/100667
2 // { dg-do compile { target c++11 } }
3
4 struct T;
5
6 #define SA(X) static_assert ((X), #X);
7
8 SA (__is_constructible(T&&, T));
9 SA (__is_constructible(const T&, T));
10 SA (!__is_constructible(T&, T));
11 SA (__is_nothrow_constructible(T&&, T));
12 SA (__is_nothrow_constructible(const T&, T));
13 SA (!__is_nothrow_constructible(T&, T));
14 SA (__is_trivially_constructible(T&&, T));
15 SA (__is_trivially_constructible(const T&, T));
16 SA (!__is_trivially_constructible(T&, T));
17
18 SA (__is_convertible(T, T&&));
19 SA (__is_convertible(T, const T&));
20 SA (!__is_convertible(T, T&));
21 SA (__is_nothrow_convertible(T, T&&));
22 SA (__is_nothrow_convertible(T, const T&));
23 SA (!__is_nothrow_convertible(T, T&));
24
25 // All false because either the conversion fails or it doesn't bind a temporary
26 SA (!__reference_constructs_from_temporary (T&&, T));
27 SA (!__reference_constructs_from_temporary (const T&, T));
28 SA (!__reference_constructs_from_temporary (T&, T));
29 SA (!__reference_converts_from_temporary (T&&, T));
30 SA (!__reference_converts_from_temporary (const T&, T));
31 SA (!__reference_converts_from_temporary (T&, T));