// PR c++/44967 // { dg-do compile { target c++11 } } template T&& declval(); template struct has_construct { typedef char one; typedef struct {char _m[2]; } two; template static decltype(declval().construct(declval(), declval()...), one()) test(int); template static two test(...); static const bool value = sizeof(test(0)) == 1; }; struct A0 {}; struct A1 { void construct(int*, int); }; template struct A2 { template void construct(_Tp1*, _Args&&...) {} }; #define SA(X) static_assert(X,#X) SA((!has_construct::value)); // ok SA((has_construct::value)); // bang SA((has_construct, int>::value)); // bang