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