1 // { dg-do compile { target c++11 } }
2 template<typename Signature>
3 struct function_traits;
4 
5 template<typename R, typename... ArgTypes>
6 struct function_traits<R(ArgTypes...)> {
7   typedef R result_type;
8 };
9 
10 template<typename R, typename Class, typename... ArgTypes>
11 struct function_traits<R (Class::*)(ArgTypes...)> {
12   typedef R result_type;
13 };
14 
15 template<typename R, typename Class, typename... ArgTypes>
16 struct function_traits<R (Class::*)(ArgTypes...) const> {
17   typedef R result_type;
18 };
19 
20 template<typename T, typename U>
21 struct same_type {
22   static const bool value = false;
23 };
24 
25 template<typename T>
26 struct same_type<T, T> {
27   static const bool value = true;
28 };
29 
30 struct X {};
31 
32 int a0[same_type<function_traits<int (X::*)()>::result_type, int>::value? 1 : -1];
33 int a1[same_type<function_traits<int (X::*)(float)>::result_type, int>::value? 1 : -1];
34 int a2[same_type<function_traits<int (X::*)(double, char)>::result_type, int>::value? 1 : -1];
35 int a3[same_type<function_traits<int (X::*)(double, char) const>::result_type, int>::value? 1 : -1];
36