aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction96.C
blob: 7fa8400830ec33c52f922bfe56bc1fc5b54ccebc (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
25
26
27
28
29
30
31
32
33
34
// PR c++/88252
// { dg-do compile { target c++17 } }

template<class T>
struct A {
  A(T&&);
  template<class U> A(T&&, U&&);
  template<class U> struct B;
};

template<class T>
A<T>::A(T&&) { }

template<class T>
template<class U>
A<T>::A(T&&, U&&) { }

template<class T>
template<class U>
struct A<T>::B {
  B(U&&);
  template<class V> B(U&&, V&&);
};

int i;

int main() {
  A{i}; // { dg-error "deduction|no match|rvalue reference" }
  A{i, 0}; // { dg-error "deduction|no match|rvalue reference" }
  A{0, i};
  A<int>::B{i}; // { dg-error "deduction|no match|rvalue reference" }
  A<int>::B{i, 0}; // { dg-error "deduction|no match|rvalue reference" }
  A<int>::B{0, i};
}