error.c (dump_function_name): Don't let the user see __comp_ctor.
[gcc.git] / gcc / cp / pt.c
index 900ef3c6c6233d43b0e5c59f1c3ccd5fa72f24da..87d4195b3175da953e435beca08f0cfdad497a58 100644 (file)
@@ -5788,6 +5788,8 @@ tsubst_decl (t, args, type, in_decl)
            maybe_retrofit_in_chrg (r);
            if (DECL_CONSTRUCTOR_P (r))
              grok_ctor_properties (ctx, r);
+           if (PRIMARY_TEMPLATE_P (gen_tmpl))
+             clone_function_decl(r, /*update_method_vec_p=*/0);
          }
        else if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
          grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
@@ -9280,15 +9282,6 @@ do_decl_instantiation (declspecs, declarator, storage)
     cp_error ("storage class `%D' applied to template instantiation",
              storage);
 
-  /* Under the new ABI, we need to make sure to instantiate all the
-     cloned versions of constructors or destructors.  */
-  if (flag_new_abi &&
-      (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (result) || 
-       DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (result)) &&
-      !(TREE_CHAIN (result) && 
-       DECL_CLONED_FUNCTION (TREE_CHAIN (result))))
-    clone_function_decl(result, /*update_method_vec_p=*/0);
-      
   SET_DECL_EXPLICIT_INSTANTIATION (result);
   mark_decl_instantiated (result, extern_p);
   repo_template_instantiated (result, extern_p);