summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx
blob: 75e14ba1460069e79a5f0e26313e5b25c0b9d00e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class foo {
  char z [10];
public:
  virtual char *get_z () { return & this->z[0]; }
};

class bar: public foo {
  char q [20];
public:
  char *get_z () { return & this->q[0]; }
};

int main () {
foo *x = new bar ();

x->get_z()[9] = 'a';

delete x;
return 0;
}