+2018-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87095
+ * decl.c (begin_destructor_body): If current_class_type has
+ virtual bases and the primary base is nearly empty virtual base,
+ voidify clearing of vptr and make it conditional on in-charge
+ argument.
+
2018-08-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85265
tree stmt = cp_build_modify_expr (input_location, vtbl_ptr,
NOP_EXPR, vtbl,
tf_warning_or_error);
+ /* If the vptr is shared with some virtual nearly empty base,
+ don't clear it if not in charge, the dtor of the virtual
+ nearly empty base will do that later. */
+ if (CLASSTYPE_VBASECLASSES (current_class_type)
+ && CLASSTYPE_PRIMARY_BINFO (current_class_type)
+ && BINFO_VIRTUAL_P
+ (CLASSTYPE_PRIMARY_BINFO (current_class_type)))
+ {
+ stmt = convert_to_void (stmt, ICV_STATEMENT,
+ tf_warning_or_error);
+ stmt = build_if_in_charge (stmt);
+ }
finish_decl_cleanup (NULL_TREE, stmt);
}
else