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

PR lto/53808
	PR c++/61659
	* pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.

From-SVN: r213311
This commit is contained in:
Jason Merrill 2014-07-30 17:29:25 -04:00 committed by Jason Merrill
parent 5b9802c45c
commit e00f67c6e0
3 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2014-07-30 Jason Merrill <jason@redhat.com>
PR lto/53808
PR c++/61659
* pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57397

View file

@ -5021,6 +5021,7 @@ template arguments to %qD do not match original template %qD",
}
if (flag_implicit_templates
&& !is_friend
&& VAR_OR_FUNCTION_DECL_P (decl))
/* Set DECL_COMDAT on template instantiations; if we force
them to be emitted by explicit instantiation or -frepo,

View file

@ -0,0 +1,13 @@
// Make sure we don't mistakenly mark f as DECL_COMDAT.
// { dg-final { scan-assembler "_Z1fv" } }
void f();
template <class T> struct A
{
friend void f();
};
A<int> a;
void f() { }