This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[patch] cleanup: remove superfluous assertion in cp/pt.c


The assertion 

  gcc_assert (TMPL_ARGS_DEPTH (args) 
	      == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)));

in register_specialization from cp/pt.c right before the call to
retrieve_specialization is superfluous, since the same condition is
checked at the top of the callee.

The following patch removes the assertion before the call.

Bootstrapped and regtested.
Ok for mainline?


2005-06-17  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* pt.c (register_specialization): Remove superfluous assertion.

===================================================================
--- gcc/gcc/cp/pt.c	3 Jun 2005 16:18:30 -0000	1.978.2.12
+++ gcc/gcc/cp/pt.c	17 Jun 2005 09:17:38 -0000
@@ -1140,11 +1140,6 @@ register_specialization (tree spec, tree
        instantiation unless and until it is actually needed.  */
     return spec;
 
-  /* There should be as many levels of arguments as there are
-     levels of parameters.  */
-  gcc_assert (TMPL_ARGS_DEPTH (args)
-	      == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)));
-
   fn = retrieve_specialization (tmpl, args,
 				/*class_specializations_p=*/false);
   /* We can sometimes try to re-register a specialization that we've
===================================================================



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