aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-06-06 03:15:33 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-06-06 03:15:33 +0000
commit7e9abee9133874562567b859de517c242bb21c6a (patch)
treef99ffcef61eba4bd28518b2193f2fe8f16f1a224 /gcc/cp/pt.c
parent7b2b3f29e59c06c3c75c62f5e9148b186d8fca07 (diff)
downloadgcc-7e9abee9133874562567b859de517c242bb21c6a.zip
gcc-7e9abee9133874562567b859de517c242bb21c6a.tar.gz
gcc-7e9abee9133874562567b859de517c242bb21c6a.tar.bz2
pt.c (instantiate_decl): Tell the repository code about the clones, not the cloned functions.
* pt.c (instantiate_decl): Tell the repository code about the clones, not the cloned functions. * repo.c (repo_template_used): Explicitly instantiate the cloned function, not the clones. From-SVN: r42931
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 19de961..b82ac02 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9821,7 +9821,25 @@ instantiate_decl (d, defer_ok)
if (pattern_defined)
{
- repo_template_used (d);
+ /* Let the repository code that this template definition is
+ available.
+
+ The repository doesn't need to know about cloned functions
+ because they never actually show up in the object file. It
+ does need to know about the clones; those are the symbols
+ that the linker will be emitting error messages about. */
+ if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (d)
+ || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (d))
+ {
+ tree t;
+
+ for (t = TREE_CHAIN (d);
+ t && DECL_CLONED_FUNCTION_P (t);
+ t = TREE_CHAIN (t))
+ repo_template_used (t);
+ }
+ else
+ repo_template_used (d);
if (flag_external_templates && ! DECL_INTERFACE_KNOWN (d))
{