1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// PR c++/79501 // { dg-do compile { target c++17 } } struct X { protected: template<class T> struct B { T t; }; template<class T> B(T) -> B<T>; }; struct Y { protected: template<class T> struct B { T t; }; private: template<class T> B(T) -> B<T>; // { dg-error "access" } };