1 // PR c++/4926 2 // { dg-do compile } 3 4 template <unsigned> struct X { typedef int Type; }; 5 template <typename T> struct Y { char array[1]; }; 6 7 template<typename T> Y<T> P(T); // acts as "Y<typeof(T)>" 8 9 struct F { int operator()() const; }; 10 11 template <typename T> 12 typename X<sizeof(P( T()() ).array)>::Type foo(); 13 14 void bar()15bar () 16 { 17 foo<F>(); 18 } 19