| 1 |
// PR c++/25814 |
| 2 |
// { dg-do compile } |
| 3 |
// Test -Wvexing-parse in a template. |
| 4 |
|
| 5 |
struct X { }; |
| 6 |
|
| 7 |
template<typename T> |
| 8 |
void fn () |
| 9 |
{ |
| 10 |
T t(); // { dg-warning "empty parentheses were disambiguated as a function declaration" } |
| 11 |
T a(X()); // { dg-warning "parentheses were disambiguated as a function declaration" } |
| 12 |
X x(T()); // { dg-warning "parentheses were disambiguated as a function declaration" } |
| 13 |
int i(T()); // { dg-warning "parentheses were disambiguated as a function declaration" } |
| 14 |
} |