aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction107.C
blob: 1492f391ec1216a6f37f6676b9ac17ea7e435b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/104641
// { dg-do compile { target c++11 } }

template<class T>
struct A {
  template<class U> struct B { B(U); };
private:
  template<class U> struct C { C(U); };
};

template<class T>
void f() {
  typename A<T>::B x = 0;
  auto y = typename A<T>::B(0);
  auto z = typename A<T>::B{0};
  typename A<T>::C w(0); // { dg-error "private" "" { target c++17 } }
}

template void f<void>();

// { dg-error "not a type" "" { target c++14_down } 13 }
// { dg-error "not a type" "" { target c++14_down } 14 }
// { dg-error "not a type" "" { target c++14_down } 15 }
// { dg-error "not a type" "" { target c++14_down } 16 }