Debian Codegraph @

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

raw
1 // { dg-do compile { target c++11 } }
2
3 #define SA(X) static_assert((X),#X)
4
5 // Positive tests.
6 using test1_type = __decay(bool);
7 SA(__is_same(test1_type, bool));
8
9 // NB: DR 705.
10 using test2_type = __decay(const int);
11 SA(__is_same(test2_type, int));
12
13 using test3_type = __decay(int[4]);
14 SA(__is_same(test3_type, __remove_extent(int[4])*));
15
16 using fn_type = void ();
17 using test4_type = __decay(fn_type);
18 SA(__is_same(test4_type, __add_pointer(fn_type)));
19
20 using cfn_type = void () const;
21 using test5_type = __decay(cfn_type);
22 SA(__is_same(test5_type, cfn_type));