* decl2.c (comdat_linkage): Treat vtables like functions.

From-SVN: r25985
This commit is contained in:
Jason Merrill 1999-03-25 19:45:25 +00:00 committed by Jason Merrill
parent e55b448636
commit 2f435bed98
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (comdat_linkage): Treat vtables like functions.
1999-03-25 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES.

View File

@ -2370,10 +2370,14 @@ comdat_linkage (decl)
{
if (flag_weak)
make_decl_one_only (decl);
else if (TREE_CODE (decl) == FUNCTION_DECL)
else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl))
/* We can just emit functions and vtables statically; it doesn't really
matter if we have multiple copies. */
TREE_PUBLIC (decl) = 0;
else
{
/* Static data member template instantiations, however, cannot
have multiple copies. */
if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node)
DECL_COMMON (decl) = 1;