summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/pmem3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/pmem3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/pmem3.C12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/pmem3.C b/gcc/testsuite/g++.old-deja/g++.jason/pmem3.C
new file mode 100644
index 000000000..1476266f6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/pmem3.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// Test that comparison of pointers to members does not complain about
+// contravariance violation.
+
+struct A { int i; };
+struct B : public A { int j; int f (); };
+int main ()
+{
+ int A::*apm = &A::i;
+ int B::*bpm = apm;
+ return apm != bpm;
+}