3 // Copyright (C) 1999 Free Software Foundation
5 // by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
6 // Based on bug report by JDonner <jdonner@schedsys.com>
9 static int bar(); // { dg-message "foo::bar" }
10 void bar(int); // { dg-message "foo::bar" }
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 *-*-* } 16 }
19 int (*ok2)() = &foo::bar; // ok
20 void (*bad2)(int) = foo::bar; // { dg-error "no matches" }
22 void (foo::*ok3)(int) = &foo::bar; // ok
23 int (foo::*bad3)() = foo::bar; // { dg-error "no matches" }