Commit 2f435bed by Jason Merrill Committed by Jason Merrill

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

From-SVN: r25985
parent e55b4486
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> 1999-03-25 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES. * pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES.
......
...@@ -2370,10 +2370,14 @@ comdat_linkage (decl) ...@@ -2370,10 +2370,14 @@ comdat_linkage (decl)
{ {
if (flag_weak) if (flag_weak)
make_decl_one_only (decl); 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; TREE_PUBLIC (decl) = 0;
else else
{ {
/* Static data member template instantiations, however, cannot
have multiple copies. */
if (DECL_INITIAL (decl) == 0 if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node) || DECL_INITIAL (decl) == error_mark_node)
DECL_COMMON (decl) = 1; DECL_COMMON (decl) = 1;
......
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