+2015-01-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/64717
+ * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
+ into SAVE_EXPR.
+
2015-01-29 Jason Merrill <jason@redhat.com>
PR c++/49508
fold_build2 (NE_EXPR, boolean_type_node, op,
build_zero_cst (TREE_TYPE (op))),
vptr, build_int_cst (uint64_type_node, 0));
- vptr = build1_loc (loc, SAVE_EXPR, uint64_type_node, vptr);
tree ti_decl = get_tinfo_decl (type);
mark_used (ti_decl);
tree ptype = build_pointer_type (type);
-2015-22-01 Uros Bizjak <ubizjak@gmail.com>
+2015-01-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/64717
+ * g++.dg/ubsan/pr64717-1.C: New test.
+ * g++.dg/ubsan/pr64717-2.C: New test.
+
+2015-01-29 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tree-ssa/pr64801.c: Fix scan-tree-dump-not directive.
--- /dev/null
+// PR c++/64717
+// { dg-do compile }
+// { dg-options "-O2 -Wuninitialized -fsanitize=vptr" }
+
+class Foo {};
+Foo make_foo ();
+
+struct Handle { virtual ~Handle (); };
+Handle open (Foo);
+
+void
+bar ()
+{
+ Handle file (open (make_foo ())); // { dg-bogus "is used uninitialized" }
+}
--- /dev/null
+// PR c++/64717
+// { dg-do compile }
+// { dg-options "-O2 -Wuninitialized -fsanitize=vptr" }
+
+class ios {};
+
+struct stringstream : virtual ios {
+ stringstream (char *);
+ ~stringstream ();
+};
+
+struct string { char *c_str (); };
+
+string make_str ();
+
+void
+bar ()
+{
+ stringstream param (make_str ().c_str ()); // { dg-bogus "is used uninitialized" }
+}