This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] cp/call.c: Stop using TREE_CHAIN for TYPE_ARG_TYPES. (Part 1)


Attached is a patch to stop using TREE_CHAIN on TYPE_ARG_TYPES.

Tested on x86_64-pc-linux-gnu on top of

OK to apply to the LTO branch?

Kazu Hirata

2006-06-19  Kazu Hirata  <>

	* cp/call.c (add_template_candidate_real): Stop using

Index: cp/call.c
--- cp/call.c	(revision 114740)
+++ cp/call.c	(working copy)
@@ -2248,9 +2260,11 @@ add_template_candidate_real (struct z_ca
      have that form.  */
   if (DECL_CONSTRUCTOR_P (fn) && list_length (arglist) == 2)
-      tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (fn);
-      if (arg_types && same_type_p (TYPE_MAIN_VARIANT (TREE_VALUE (arg_types)),
-				    ctype))
+      tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
+      int skip = num_artificial_parms_for (fn);
+      if (skip < num_parm_types (arg_types)
+	  && same_type_p (TYPE_MAIN_VARIANT (nth_parm_type (arg_types, skip)),
+			  ctype))
 	return NULL;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]