1 // PR c++/53788 2 // { dg-do compile { target c++11 } } 3 4 struct t { static const bool value = true; }; 5 struct f { static const bool value = false; }; 6 7 template<typename T> 8 struct has_static { 9 template<typename X> 10 static t check(X*, decltype(T::fun())* = 0); // { dg-error "without object" } 11 static f check(...); 12 13 typedef decltype(check((T*)(0))) ret; 14 static const bool value = ret::value; 15 }; 16 funtest17struct test { int fun() { return 0; } }; 18 19 bool b = has_static<test>::value; 20