Debian Codegraph @

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

raw
1 // { dg-do compile { target c++11 } }
2
3 #define SA(X) static_assert((X),#X)
4
5 class ClassType { };
6 using cClassType = const ClassType;
7 using vClassType = volatile ClassType;
8 using cvClassType = const volatile ClassType;
9
10 // Positive tests.
11 SA(__is_volatile(volatile int));
12 SA(__is_volatile(const volatile int));
13 SA(__is_volatile(vClassType));
14 SA(__is_volatile(cvClassType));
15
16 // Negative tests.
17 SA(!__is_volatile(int));
18 SA(!__is_volatile(const int));
19 SA(!__is_volatile(ClassType));
20 SA(!__is_volatile(cClassType));