aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx')
-rw-r--r--gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx b/gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx
new file mode 100644
index 000000000..75e14ba14
--- /dev/null
+++ b/gcc-4.4.3/libmudflap/testsuite/libmudflap.c++/pass28-frag.cxx
@@ -0,0 +1,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;
+}