#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: In function 'int main()':
prog.cpp:5:9: error: 'int A::a' is private
int a;
^
prog.cpp:18:13: error: within this context
test<A> a;
^
Standard output is empty