Delete unused PoisonChecking utility pass
[llvm-project.git] / clang / test / CXX / temp / temp.fct.spec / temp.deduct / sfinae-1.cpp
blob1907bd77998f204a34aaf5043e1a6463660c7251
1 // RUN: %clang_cc1 -verify %s
2 // expected-no-diagnostics
4 typedef char one_byte;
5 struct two_bytes { char data[2]; };
7 template<typename T> one_byte __is_class_check(int T::*);
8 template<typename T> two_bytes __is_class_check(...);
10 template<typename T> struct is_class {
11 static const bool value = sizeof(__is_class_check<T>(0)) == 1;
14 struct X { };
16 int array0[is_class<X>::value? 1 : -1];
17 int array1[is_class<int>::value? -1 : 1];
18 int array2[is_class<char[3]>::value? -1 : 1];
20 namespace instantiation_order1 {
21 template<typename T>
22 struct it_is_a_trap {
23 typedef typename T::trap type;
26 template<bool, typename T = void>
27 struct enable_if {
28 typedef T type;
31 template<typename T>
32 struct enable_if<false, T> { };
34 template<typename T>
35 typename enable_if<sizeof(T) == 17>::type
36 f(const T&, typename it_is_a_trap<T>::type* = 0);
38 void f(...);
40 void test_f() {
41 f('a');