diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem4.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem4.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem4.C b/gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem4.C new file mode 100644 index 000000000..4f3f541e5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem4.C @@ -0,0 +1,18 @@ +// Bug: This checks that the pointer-to-member-function type is not +// shared between differently-qualified pointer-to-method types. + +// { dg-do compile } +struct A +{ + void f () {} +}; + +void (A::*const cp)() = &A::f; + +int main () +{ + void (A::* p)(); + void (A::** ip)() = &p; + + *ip = &A::f; +} |