#include <iostream> class A{ int a;}; template<typename, typename = void>struct test{}; template<typename T>struct test<T, decltype(T::a)>{}; int main(){ test<A> a;}
Standard input is empty
prog.cpp:13:29: error: a function call cannot appear in a constant-expression struct test<T, decltype(T::a)> ^ prog.cpp:13:30: error: template argument 2 is invalid struct test<T, decltype(T::a)> ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!