* g++.old-deja/g++.benjamin/13478.C: Mark candidate.
* g++.old-deja/g++.mike/net36.C: Mark candidate.
* g++.old-deja/g++.robertl/eb131.C: Mark candidate.
* g++.old-deja/g++.oliva/overload1.C: Remove XFAIL.
* g++.old-deja/g++.other/ptrmem7.C: New test.
* g++.old-deja/g++.pt/ptrmem10.C: New test.
From-SVN: r35778
+2000-08-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.benjamin/13478.C: Mark candidate.
+ * g++.old-deja/g++.mike/net36.C: Mark candidate.
+ * g++.old-deja/g++.robertl/eb131.C: Mark candidate.
+ * g++.old-deja/g++.oliva/overload1.C: Remove XFAIL.
+ * g++.old-deja/g++.other/ptrmem7.C: New test.
+ * g++.old-deja/g++.pt/ptrmem10.C: New test.
+
2000-08-18 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/typename27.C: New test.
static const hand_table table_1[];
static const AData table_2;
private:
- void foo (void);
+ void foo (void); // ERROR - candidate
};
const hand_table Agent::table_1[] =
class B {
public:
- void setHandler(handler);
+ void setHandler(handler); // ERROR - candidate
};
void f(B* b) {
/* gcc emits a hard error without -pedantic, and a warning with
-pedantic, even in bad1. */
-int (*ok1)() = foo::bar; // gets bogus error - XFAIL *-*-*
+int (*ok1)() = foo::bar;
void (foo::*bad1)(int) = foo::bar; // ERROR - missing &
int (*ok2)() = &foo::bar; // ok
--- /dev/null
+// Build don't link:
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com>
+
+// A pointer to member can only be formed by `&T::m', however, other forms
+// are ok for pointer to static member. Thus the error can only be determined
+// after overload resolution.
+
+struct A
+{
+ static int ns (short);
+ static int ns (float);
+ int ns (int);
+ int ns (double);
+ int single (int);
+ static int sole (short);
+ void foo ();
+};
+void A::foo ()
+{
+ int (A::*ptr1) (int) = &A::ns;
+ int (A::*ptr2) (int) = A::ns; // ERROR - not ptr mem
+ int (A::*ptr3) (int) = &ns; // ERROR - not ptr mem
+ int (A::*ptr4) (int) = ns; // ERROR - not ptr mem
+
+ int (*ptr5) (short) = &A::ns;
+ int (*ptr6) (short) = A::ns;
+ int (*ptr7) (short) = &ns;
+ int (*ptr8) (short) = ns;
+
+ int (A::*ptr11) (int) = &A::single;
+ int (A::*ptr12) (int) = A::single; // ERROR - not ptr mem
+ int (A::*ptr13) (int) = &single; // ERROR - not ptr mem
+ int (A::*ptr14) (int) = single; // ERROR - not ptr mem
+
+ int (A::*ptr20) (int) = &(A::ns); // ERROR - not ptr mem
+ int (A::*ptr21) (int) = &(A::single); // ERROR - not ptr mem
+
+ int (*ptr31) (short) = &A::sole;
+ int (*ptr32) (short) = A::sole;
+ int (*ptr33) (short) = &sole;
+ int (*ptr34) (short) = sole;
+ int (*ptr41) (short) = &(A::sole);
+ int (*ptr43) (short) = &(sole);
+}
--- /dev/null
+// Build don't link:
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com>
+
+// A pointer to member can only be formed by `&T::m', however, other forms
+// are ok for pointer to static member. Thus the error can only be determined
+// after overload resolution. In template deduction, this can disambiguate
+// otherwise ambiguous cases.
+
+struct A
+{
+ static int f (int);
+ int f (short);
+ void baz ();
+};
+
+template <typename T> void foo (int (*)(T)); // ERROR - candidate
+template <typename T> void foo (int (A::*)(T)); // ERROR - candidate
+
+
+void A::baz ()
+{
+ foo (&A::f); // ERROR - ambiguous
+ foo (A::f);
+ foo (&(A::f));
+ foo (f);
+ foo (&f);
+}
void bar( double );
void bar( float );
- void foo( void (a::*member)(float) );
+ void foo( void (a::*member)(float) ); // ERROR - candidate
};
a::a()