* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae50.C
blobe8d90ca76816dabf6245e6ac1d88f36491ef77e7
1 // PR c++/61083
2 // { dg-do compile { target c++11 } }
4 template<typename T> T declval();
6 template<typename T, typename U>
7 struct is_same {
8   static const bool value = false;
9 };
11 template<typename T>
12 struct is_same<T, T> {
13   static const bool value = true;
16 struct true_type {};
17 struct false_type {};
19 template <typename T>
20 struct is_foo {
21 private:
22   template<typename U, U> struct helper {};
24   template <typename Z> static auto
25   test(Z z) -> decltype(helper<void (Z::*)() const, &Z::foo>(), true_type());
27   template <typename> static auto test(...) -> false_type;
29 public:
30   enum { value = is_same<decltype(test<T>(declval<T>())), true_type>::value };
33 struct A { 
34   int foo();
35   void foo() const; 
38 struct A1 : public A {};
40 static_assert (is_foo<A>::value == 1, "");
41 static_assert (is_foo<A1>::value == 0, "");