| 1 |
// PR c++/71450 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
struct A { A operator+ (A a) { return a; } }; |
| 5 |
|
| 6 |
template <class T> |
| 7 |
void foo (T t) |
| 8 |
{ |
| 9 |
auto x = t + x; // { dg-error "use of 'x' before deduction of 'auto'" } |
| 10 |
} |
| 11 |
|
| 12 |
int |
| 13 |
main () |
| 14 |
{ |
| 15 |
foo (A ()); |
| 16 |
} |