https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659
--- Comment #18 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Wed Jul 30 17:27:14 2014 New Revision: 213307 URL: https://gcc.gnu.org/viewcvs?rev=213307&root=gcc&view=rev Log: PR lto/53808 PR c++/61659 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates. (check_explicit_specialization): Clear it on specializations. * decl.c (duplicate_decls, start_decl): Likewise. (grokmethod, grokfndecl): Set DECL_COMDAT on inlines. * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine linkage after setting the appropriate flags. * tree.c (decl_linkage): Don't check DECL_COMDAT. * decl2.c (mark_needed): Mark clones. (import_export_decl): Not here. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/cp/decl2.c trunk/gcc/cp/method.c trunk/gcc/cp/pt.c trunk/gcc/cp/tree.c trunk/gcc/testsuite/g++.dg/opt/devirt4.C