PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / memclass3.C
blob8230b94e5b93ec0a7ee67edc37edf3e1c9c53f9c
1 // PR c++/17132
3 template <typename T>
4 struct has_deref
6     struct impl
7     {
8         template <
9             typename Type,
10             typename Type::reference (Type::*Func)(void) const>
11         struct func_tag;
13         template <typename Type>
14         static char (& test(
15             Type *,
16             func_tag<Type, &Type::operator*> * = 0
17         ))[2];
18         static char test(void *);
19     };
21     static const bool value = (sizeof(impl::test((T *) 0)) == 2);
24 template <typename T>
25 struct container
27     struct iterator
28     {
29         typedef T & reference;
30         reference operator*() const;
31     };
34 int main()
36     typedef container<int>::iterator iter;
37     int result = has_deref<iter>::value;
38     return result;