Commit c3439626 by Jason Merrill Committed by Jason Merrill

re PR c++/60347 (r208153 breaks Firefox build)

	PR c++/60347
	PR lto/53808
	* class.c (clone_function_decl): Don't note_vague_linkage_fn.
	* init.c (build_vtbl_address): Do it here.

From-SVN: r208184
parent ca7e759d
2014-02-26 Jason Merrill <jason@redhat.com>
PR c++/60347
PR lto/53808
* class.c (clone_function_decl): Don't note_vague_linkage_fn.
* init.c (build_vtbl_address): Do it here.
PR c++/59231
PR c++/11586
PR c++/14710
......
......@@ -4584,10 +4584,6 @@ clone_function_decl (tree fn, int update_method_vec_p)
destructor. */
if (DECL_VIRTUAL_P (fn))
{
if (DECL_DEFAULTED_FN (fn) && flag_devirtualize)
/* Make sure the destructor gets synthesized so that it can be
inlined after devirtualization. */
note_vague_linkage_fn (fn);
clone = build_clone (fn, deleting_dtor_identifier);
if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
......
......@@ -1123,7 +1123,13 @@ build_vtbl_address (tree binfo)
/* Figure out what vtable BINFO's vtable is based on, and mark it as
used. */
vtbl = get_vtbl_decl_for_binfo (binfo_for);
TREE_USED (vtbl) = 1;
if (tree dtor = CLASSTYPE_DESTRUCTORS (DECL_CONTEXT (vtbl)))
if (!TREE_USED (vtbl) && DECL_VIRTUAL_P (dtor) && DECL_DEFAULTED_FN (dtor))
/* Make sure the destructor gets synthesized so that it can be
inlined after devirtualization even if the vtable is never
emitted. */
note_vague_linkage_fn (dtor);
TREE_USED (vtbl) = true;
/* Now compute the address to use when initializing the vptr. */
vtbl = unshare_expr (BINFO_VTABLE (binfo_for));
......
// PR c++/60347
struct A;
template <class T>
struct B
{
T* p;
virtual ~B() { p->~T(); }
};
struct C: B<A> { };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment