OSDN Git Service

* g++.dg/opt/ptrmem3.C: New test.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2003 16:59:36 +0000 (16:59 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2003 16:59:36 +0000 (16:59 +0000)
* g++.old-deja/g++.pt/overload8.C: Remove XFAIL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70851 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/ptrmem3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/overload8.C

index 2e96a62..576845a 100644 (file)
@@ -1,3 +1,9 @@
+2003-08-27  Mark Mitchell  <mark@codesourcery.com>
+
+       * g++.dg/opt/ptrmem3.C: New test.
+
+       * g++.old-deja/g++.pt/overload8.C: Remove XFAIL.
+
 2003-08-27  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/20030826-2.c: New test.
diff --git a/gcc/testsuite/g++.dg/opt/ptrmem3.C b/gcc/testsuite/g++.dg/opt/ptrmem3.C
new file mode 100644 (file)
index 0000000..552a92c
--- /dev/null
@@ -0,0 +1,23 @@
+// { dg-options "-O1" }
+
+#include <stdio.h>
+struct A {
+     A(int arg) : ia(arg) {}
+     int x,y,z,ia;
+     int mf(int arg) { return arg + ia; }
+};
+int func(int A::*pdm, int (A::*pmf)(int)) //      2.      regular function
+{ 
+     A oa(2);
+     return ((&oa)->*pdm) + (oa.*pmf)(2); 
+}       
+int main()
+{
+     int val;
+
+     int A::*pda = &A::ia;           
+     int (A::*pmfa)(int) = &A::mf;   
+     val = func( pda, pmfa );
+     if(val != 6)
+       printf("val=%d, expect 6 \n", val);
+}
index 4f0a1d0..5c2d8bc 100644 (file)
@@ -7,6 +7,6 @@ struct baz;
 void operator*(baz&, double);
 
 template <class T> inline T operator*(double s, const T &p)
-  ; // { dg-bogus "" "" { xfail *-*-* } }  - must have argument of class type - 
+  ; // { dg-bogus "" "" }  - must have argument of class type - 
 
 void m(baz& a) { a * .5; }