| 1 |
// { dg-do assemble } |
| 2 |
// g++ 1.36.1 bug 900127_01 |
| 3 |
|
| 4 |
// g++ often fails to detect (and issue errors for) ambiguous overload |
| 5 |
// situations. In such cases, one of the possibilities is chosen |
| 6 |
// (apparently arbitrarily). Errors should be issued instead. |
| 7 |
|
| 8 |
// Cfront 2.0 passes this test. |
| 9 |
|
| 10 |
// keywords: function overloading, ambiguity |
| 11 |
|
| 12 |
void foo (int); |
| 13 |
int foo (void); |
| 14 |
|
| 15 |
typedef int (*f_ptr_t1) (void); |
| 16 |
typedef void (*f_ptr_t2) (int); |
| 17 |
|
| 18 |
void bar (f_ptr_t1); // { dg-message "note" } |
| 19 |
void bar (f_ptr_t2); // { dg-message "note" } |
| 20 |
|
| 21 |
void function () |
| 22 |
{ |
| 23 |
bar (foo); // { dg-error "ambiguous" } |
| 24 |
} |
| 25 |
|
| 26 |
int main () { return 0; } |