Commit 6e6eaecc by Jason Merrill Committed by Jason Merrill

re PR lto/53808 (Undefined symbol when building a library with lto)

	PR lto/53808
	* class.c (clone_function_decl): Call note_vague_linkage_fn for
	defaulted virtual dtor.

From-SVN: r208153
parent d808e92e
2014-02-25 Jason Merrill <jason@redhat.com> 2014-02-25 Jason Merrill <jason@redhat.com>
PR lto/53808
* class.c (clone_function_decl): Call note_vague_linkage_fn for
defaulted virtual dtor.
DR 1286 DR 1286
PR c++/60328 PR c++/60328
* pt.c (get_underlying_template): Fix equivalence calculation. * pt.c (get_underlying_template): Fix equivalence calculation.
......
...@@ -4582,6 +4582,10 @@ clone_function_decl (tree fn, int update_method_vec_p) ...@@ -4582,6 +4582,10 @@ clone_function_decl (tree fn, int update_method_vec_p)
destructor. */ destructor. */
if (DECL_VIRTUAL_P (fn)) 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); clone = build_clone (fn, deleting_dtor_identifier);
if (update_method_vec_p) if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone, NULL_TREE); add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
......
// PR lto/53808
// Devirtualization + inlining should produce a non-virtual
// call to ~foo.
// { dg-options "-O -fdevirtualize" }
// { dg-final { scan-assembler "_ZN3fooD2Ev" } }
struct foo {
virtual ~foo();
};
struct bar : public foo {
virtual void zed();
};
void f() {
foo *x(new bar);
delete x;
}
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