Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/class-deduction107.C

raw
1 // PR c++/104641
2 // { dg-do compile { target c++11 } }
3
4 template<class T>
5 struct A {
6 template<class U> struct B { B(U); };
7 private:
8 template<class U> struct C { C(U); };
9 };
10
11 template<class T>
12 void f() {
13 typename A<T>::B x = 0;
14 auto y = typename A<T>::B(0);
15 auto z = typename A<T>::B{0};
16 typename A<T>::C w(0); // { dg-error "private" "" { target c++17 } }
17 }
18
19 template void f<void>();
20
21 // { dg-error "not a type" "" { target c++14_down } 13 }
22 // { dg-error "not a type" "" { target c++14_down } 14 }
23 // { dg-error "not a type" "" { target c++14_down } 15 }
24 // { dg-error "not a type" "" { target c++14_down } 16 }