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) {} // { dg-message "note" }
9 template<class F> void bindm(F f) {} // { dg-message "note" }
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 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 42 }
44 bind (&foo::barf); // { dg-error "no matching function" }
45 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 44 }
47 bindm (&barf); // { dg-error "no matching function" }
48 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 47 }
55 bindb (&foo::barf); // { dg-error "ambiguous" }
56 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 55 }
58 bind (&bark); // { dg-error "no matching function" }
59 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 58 }
60 bind (&bar::bark); // { dg-error "no matching function" }
61 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 60 }
63 bindm (&bark); // { dg-error "no matching function" }
64 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 63 }
71 bindb (&bar::bark); // { dg-error "ambiguous" }
72 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 71 }
81 static void bark (int);
86 bind (&bait); // { dg-error "from this location" }
91 bind (&baikt); // ok, this->baikt
94 bind (&barf); // { dg-error "no matching function" }
95 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 94 }
96 bind (&foo::barf); // { dg-error "no matching function" }
97 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 96 }
99 bindm (&barf); // { dg-error "no matching function" }
100 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 99 }
107 bindb (&foo::barf); // { dg-error "ambiguous" }
108 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 107 }
110 bind (&bark); // { dg-error "no matching function" }
111 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 110 }
112 bind (&barT::bark); // { dg-error "no matching function" }
113 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 112 }
115 bindm (&bark); // { dg-error "no matching function" }
116 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 115 }
123 bindb (&barT::bark); // { dg-error "ambiguous" }
124 // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 123 }