diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/operator11.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/operator11.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/operator11.C b/gcc/testsuite/g++.dg/template/operator11.C new file mode 100644 index 000000000..8d6b77ab4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/operator11.C @@ -0,0 +1,25 @@ +// PR c++/48594 +// Test for uses of (X->*Y)() that don't actually involve a +// pointer to member function. + +struct A { } a; +struct B { } b; +struct C * cp; + +struct Func { void operator()(); }; +Func operator->* (A, int); + +typedef void (*pfn)(); +pfn operator->* (B, int); + +pfn C::*cpfn; +Func C::*cfunc; + +template <class T> +void f() +{ + (a->*1)(); + (b->*1)(); + (cp->*cpfn)(); + (cp->*cfunc)(); +} |