PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae63.C
blob7ad38497c0b87b9a6cc8d8fbf7bb63dbb25e42a0
1 // PR c++/61806
2 // { dg-do compile { target c++11 } }
4 struct true_type 
6   static const bool value = true;
7 };
9 struct false_type 
11   static const bool value = false;
14 template<class T>
15 T&& declval();
17 template<typename> struct check { typedef void type; };
19 template<typename T, typename Enable = void>
20 struct has_public_f : false_type {};
22 template<typename T>
23 struct has_public_f<
24     T,
25     typename check<
26         decltype(
27             declval<T&>().f()
28         )
29     >::type
30 > : true_type {};
33 struct Spub  { public: void f(); };
34 struct Spriv { private: void f(); };
36 static_assert( has_public_f<Spub>::value, "Ouch");
37 static_assert(!has_public_f<Spriv>::value, "Ouch");
39 int main() {}