// PR c++/51213 // { dg-do compile { target c++11 } } class C { typedef int type; }; template struct I; template<> struct I<2> { }; template auto f(int) -> char; template auto f(...) -> char (&)[2]; static_assert(sizeof(f(0)) == 2, "Ouch"); typedef int testf[sizeof(f(0)) == 2 ? 1 : -1]; I(0))> vf; template auto g(int) -> decltype(typename T::type(), char()); template auto g(...) -> char (&)[2]; static_assert(sizeof(g(0)) == 2, "Ouch"); typedef int testg[sizeof(g(0)) == 2 ? 1 : -1]; I(0))> vg;