aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C b/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C
new file mode 100644
index 000000000..e438d24fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C
@@ -0,0 +1,18 @@
+// PR sanitizer/59250
+// { dg-do compile }
+// { dg-options "-fsanitize=undefined" }
+
+struct E {
+ int i;
+};
+
+struct S {
+ const char *s;
+ S (const char *);
+ static E *e;
+};
+
+S::S (const char *) : s (0)
+{
+ e = new E ();
+}