From: Mark Mitchell Date: Wed, 27 Aug 2003 16:59:36 +0000 (+0000) Subject: ptrmem3.C: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=031b59ce354bedebe9ecd57e90be14026ba77523;p=gcc.git ptrmem3.C: New test. * g++.dg/opt/ptrmem3.C: New test. * g++.old-deja/g++.pt/overload8.C: Remove XFAIL. From-SVN: r70851 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2e96a627549..576845a0dd7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-08-27 Mark Mitchell + + * g++.dg/opt/ptrmem3.C: New test. + + * g++.old-deja/g++.pt/overload8.C: Remove XFAIL. + 2003-08-27 Jakub Jelinek * 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 00000000000..552a92c9c1a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/ptrmem3.C @@ -0,0 +1,23 @@ +// { dg-options "-O1" } + +#include +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 4f0a1d0ad08..5c2d8bc026e 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 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; }