aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-08-27 16:59:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-08-27 16:59:36 +0000
commit031b59ce354bedebe9ecd57e90be14026ba77523 (patch)
tree6d9c76ee42a844fe90fcd711946acade4926237a /gcc
parent036e07f263ab62b11fb6c34402b5a0a1e92c5eb9 (diff)
downloadgcc-031b59ce354bedebe9ecd57e90be14026ba77523.zip
gcc-031b59ce354bedebe9ecd57e90be14026ba77523.tar.gz
gcc-031b59ce354bedebe9ecd57e90be14026ba77523.tar.bz2
ptrmem3.C: New test.
* g++.dg/opt/ptrmem3.C: New test. * g++.old-deja/g++.pt/overload8.C: Remove XFAIL. From-SVN: r70851
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/opt/ptrmem3.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/overload8.C2
3 files changed, 30 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2e96a62..576845a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..552a92c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/ptrmem3.C
@@ -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);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload8.C b/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
index 4f0a1d0..5c2d8bc 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
@@ -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; }