From 212e70482f2cf205a9cb82744a89a582b36d87ee Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 24 May 2000 04:34:38 +0000 Subject: [PATCH] decl2.c (maybe_retrofit_in_chrg): Don't create in-charge parameters for template functions. * decl2.c (maybe_retrofit_in_chrg): Don't create in-charge parameters for template functions. * pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for destructors as well as constructors. From-SVN: r34120 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/decl2.c | 5 +++++ gcc/cp/pt.c | 5 +++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 40e7175a8d6..d9ebe0369e2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2000-05-23 Mark Mitchell + + * decl2.c (maybe_retrofit_in_chrg): Don't create in-charge + parameters for template functions. + * pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for + destructors as well as constructors. + 2000-05-22 Mark Mitchell * class.c (build_ctor_vtbl_group): Set inits. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a8ab3fd858f..c88779ca7ad 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -944,6 +944,11 @@ maybe_retrofit_in_chrg (fn) if (DECL_HAS_IN_CHARGE_PARM_P (fn)) return; + /* When processing templates we can't know, in general, whether or + not we're going to have virtual baseclasses. */ + if (uses_template_parms (fn)) + return; + /* We don't need an in-charge parameter for constructors that don't have virtual bases. */ if (DECL_CONSTRUCTOR_P (fn) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 04cac4e04e7..5e2ff5e4735 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5784,10 +5784,11 @@ tsubst_decl (t, args, type, in_decl) in_decl); } - if (DECL_CONSTRUCTOR_P (r)) + if (DECL_CONSTRUCTOR_P (r) || DECL_DESTRUCTOR_P (r)) { maybe_retrofit_in_chrg (r); - grok_ctor_properties (ctx, r); + if (DECL_CONSTRUCTOR_P (r)) + grok_ctor_properties (ctx, r); } else if (DECL_OVERLOADED_OPERATOR_P (r)) grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));