3 // Copyright 2005 Free Software Foundation
4 // contributed by Alexandre Oliva <aoliva@redhat.com>
5 // inspired in the failure reported in Red Hat bugzilla #168260.
7 template<class F> void bind(F f) {}
9 template<class F> void bindm(F f) {}
10 template<class F, class T> void bindm(F (T::*f)(void)) {} // { dg-message "note" }
12 template<class F> void bindn(F f) {}
13 template<class F, class T> void bindn(F (*f)(T)) {}
15 template<class F> void bindb(F f) {}
16 template<class F, class T> void bindb(F (*f)(T)) {} // { dg-message "note" }
17 template<class F, class T> void bindb(F (T::*f)(void)) {} // { dg-message "note" }
21 int bait; // { dg-error "non-static data member" }
23 static void barf (int);
29 static void bark (int);
34 bind (&bait); // { dg-error "from this location" }
39 bind (&baikt); // ok, this->baikt
42 bind (&barf); // { dg-error "no matching function" }
43 bind (&foo::barf); // { dg-error "no matching function" }
45 bindm (&barf); // { dg-error "no matching function" }
52 bindb (&foo::barf); // { dg-error "ambiguous" }
54 bind (&bark); // { dg-error "no matching function" }
55 bind (&bar::bark); // { dg-error "no matching function" }
57 bindm (&bark); // { dg-error "no matching function" }
64 bindb (&bar::bark); // { dg-error "ambiguous" }
73 static void bark (int);
78 bind (&bait); // { dg-error "from this location" }
83 bind (&baikt); // ok, this->baikt
86 bind (&barf); // { dg-error "no matching function" }
87 bind (&foo::barf); // { dg-error "no matching function" }
89 bindm (&barf); // { dg-error "no matching function" }
96 bindb (&foo::barf); // { dg-error "ambiguous" }
98 bind (&bark); // { dg-error "no matching function" }
99 bind (&barT::bark); // { dg-error "no matching function" }
101 bindm (&bark); // { dg-error "no matching function" }
108 bindb (&barT::bark); // { dg-error "ambiguous" }