summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr71624.C
blob: 951534ce875147ef0d40f9894f8334a7db14a484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* PR71624 */
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
/* { 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);
}