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