| 1 |
// { dg-do assemble } |
| 2 |
|
| 3 |
// Copyright (C) 1999 Free Software Foundation |
| 4 |
|
| 5 |
// by Alexandre Oliva <[email protected]> |
| 6 |
// Based on bug report by JDonner <[email protected]> |
| 7 |
|
| 8 |
struct foo { |
| 9 |
static int bar(); // { dg-message "foo::bar" } |
| 10 |
void bar(int); // { dg-message "foo::bar" } |
| 11 |
}; |
| 12 |
|
| 13 |
/* gcc emits a hard error without -pedantic, and a warning with |
| 14 |
-pedantic, even in bad1. */ |
| 15 |
int (*ok1)() = foo::bar; |
| 16 |
void (foo::*bad1)(int) = foo::bar; // { dg-error "assuming pointer" } |
| 17 |
// { dg-message "note" "note" { target *-*-* } .-1 } |
| 18 |
|
| 19 |
int (*ok2)() = &foo::bar; // ok |
| 20 |
void (*bad2)(int) = foo::bar; // { dg-error "no matches" } |
| 21 |
|
| 22 |
void (foo::*ok3)(int) = &foo::bar; // ok |
| 23 |
int (foo::*bad3)() = foo::bar; // { dg-error "no matches" } |
| 24 |
|