| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-fpermissive" } |
| 3 |
|
| 4 |
template<int> int foo() |
| 5 |
{ |
| 6 |
return ({ foo; }); // { dg-warning "insufficient context" } |
| 7 |
} |
| 8 |
|
| 9 |
int bar() |
| 10 |
{ |
| 11 |
return ({ foo; }); // { dg-error "insufficient context" } |
| 12 |
} |
| 13 |
|
| 14 |
void bar(int); |
| 15 |
|
| 16 |
typedef void (*bart)(int); |
| 17 |
|
| 18 |
bart barf() |
| 19 |
{ |
| 20 |
return ({ bar; }); // { dg-error "insufficient context" } |
| 21 |
} |
| 22 |
|
| 23 |
bool bark() |
| 24 |
{ |
| 25 |
return ({ barf; }); // ok, no overload |
| 26 |
} |
| 27 |
|
| 28 |
template <typename T> |
| 29 |
class C |
| 30 |
{ |
| 31 |
static int f(); |
| 32 |
bool g() |
| 33 |
{ |
| 34 |
return ({ f; }); // ok, no overload |
| 35 |
} |
| 36 |
bool g(int) |
| 37 |
{ |
| 38 |
return ({ g; }); // { dg-warning "insufficient context" } |
| 39 |
} |
| 40 |
}; |