13478.C: Mark candidate.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 18 Aug 2000 09:31:48 +0000 (09:31 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 18 Aug 2000 09:31:48 +0000 (09:31 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.benjamin/13478.C
gcc/testsuite/g++.old-deja/g++.mike/net36.C
gcc/testsuite/g++.old-deja/g++.oliva/overload1.C
gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.robertl/eb131.C

index 846533114128da4864363bb364c6ba9455e2d06e..34d1f05525f799ea181b1f6048e0398d03eed5ca 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 97256ed7643d6483497f03bc65cbb181fcfea59a..c4dba9c117c9e2307b6c8d06e1e5b84916e43a2b 100644 (file)
@@ -19,7 +19,7 @@ protected:
   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[] = 
index 843c31421adc9cbdc5a42b67703c6dd2cc448e26..21c3a1ee1a076391335145444c5c138530d99d73 100644 (file)
@@ -11,7 +11,7 @@ typedef void (A::*handler) (X*);
 
 class B {
 public:
-  void setHandler(handler);
+  void setHandler(handler); // ERROR - candidate
 };
 
 void f(B* b) {
index fd79dad94031ba5124db791332426526815279d1..ed8993a43a621c11a0f17048f5043fab94b3c1f1 100644 (file)
@@ -12,7 +12,7 @@ struct foo {
 
 /* 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
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C
new file mode 100644 (file)
index 0000000..188af76
--- /dev/null
@@ -0,0 +1,46 @@
+// 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);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C
new file mode 100644 (file)
index 0000000..0e7a6d7
--- /dev/null
@@ -0,0 +1,29 @@
+// 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);
+}
index 1768dd09063dfbdb1b2d27a06bbff06c5b76a510..34ee0af399906dcd5663b47099956e1186fc253c 100644 (file)
@@ -10,7 +10,7 @@ struct a {
        void bar( double );
        void bar( float );
 
-  void foo( void (a::*member)(float) );
+  void foo( void (a::*member)(float) );   // ERROR - candidate
 };
 
 a::a()