| 1 |
// PR c++/88252 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
|
| 4 |
template<class T> |
| 5 |
struct A { |
| 6 |
A(T&&); |
| 7 |
template<class U> A(T&&, U&&); |
| 8 |
template<class U> struct B; |
| 9 |
}; |
| 10 |
|
| 11 |
template<class T> |
| 12 |
A<T>::A(T&&) { } |
| 13 |
|
| 14 |
template<class T> |
| 15 |
template<class U> |
| 16 |
A<T>::A(T&&, U&&) { } |
| 17 |
|
| 18 |
template<class T> |
| 19 |
template<class U> |
| 20 |
struct A<T>::B { |
| 21 |
B(U&&); |
| 22 |
template<class V> B(U&&, V&&); |
| 23 |
}; |
| 24 |
|
| 25 |
int i; |
| 26 |
|
| 27 |
int main() { |
| 28 |
A{i}; // { dg-error "deduction|no match|rvalue reference" } |
| 29 |
A{i, 0}; // { dg-error "deduction|no match|rvalue reference" } |
| 30 |
A{0, i}; |
| 31 |
A<int>::B{i}; // { dg-error "deduction|no match|rvalue reference" } |
| 32 |
A<int>::B{i, 0}; // { dg-error "deduction|no match|rvalue reference" } |
| 33 |
A<int>::B{0, i}; |
| 34 |
} |