decl2.c (maybe_retrofit_in_chrg): Don't create in-charge parameters for template...
authorMark Mitchell <mark@codesourcery.com>
Wed, 24 May 2000 04:34:38 +0000 (04:34 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 24 May 2000 04:34:38 +0000 (04:34 +0000)
* 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
gcc/cp/decl2.c
gcc/cp/pt.c

index 40e7175a8d6ee8086527ced55c1cf26ca7985a2d..d9ebe0369e29ff5754b210da9edb66c3d51b39db 100644 (file)
@@ -1,3 +1,10 @@
+2000-05-23  Mark Mitchell  <mark@codesourcery.com>
+
+       * 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  <mark@codesourcery.com>
 
        * class.c (build_ctor_vtbl_group): Set inits.
index a8ab3fd858f69bf22d7241e45d9927742422290a..c88779ca7add1cdb9375955ebd846bb419df2446 100644 (file)
@@ -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)
index 04cac4e04e7fe4c0f9c5949e31b6a86bf82820ac..5e2ff5e4735ed6bb24557da8ff530dbd0cf1f5d2 100644 (file)
@@ -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));