aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr71624.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/pr71624.C')
-rw-r--r--gcc/testsuite/g++.dg/pr71624.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pr71624.C b/gcc/testsuite/g++.dg/pr71624.C
new file mode 100644
index 00000000000..94a75cd4c41
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr71624.C
@@ -0,0 +1,35 @@
+/* PR71624 */
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
+
+class c1
+{
+public:
+ virtual int fn1 () const;
+ int fn2 (const int *) const;
+};
+
+class c2
+{
+ int fn1 ();
+ c1 obj;
+};
+
+int
+c1::fn1 () const
+{
+ return 0;
+}
+
+int
+c1::fn2 (const int *) const
+{
+ return this->fn1 ();
+}
+
+int
+c2::fn1 ()
+{
+ return obj.fn2 (0);
+}
+