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]

Re: [Patch] PR c++/42824


On 02/11/2010 12:07 PM, Dodji Seketeli wrote:
+	  /* The enclosing class must be an instantiation ... */
+	  CLASS_TYPE_P (template_type)
+	&&  TYPE_CONTEXT (template_type)
+	&&  CLASS_TYPE_P (TYPE_CONTEXT (template_type))
+	&&  CLASSTYPE_TEMPLATE_INFO (TYPE_CONTEXT (template_type))
+	&&  DECL_CONTEXT (gen_tmpl)
+	&&  CLASS_TYPE_P (DECL_CONTEXT (gen_tmpl))
+	&&  CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (gen_tmpl))
+	&&  tmpl_has_one_outermost_arg_and_parm_not_equivalent_p
+	     (arglist, DECL_TEMPLATE_PARMS (gen_tmpl))

I think this can all be simplified a lot by moving this assignment down to the comment "We have to figure out which template is the immediate parent," since at that point we've already substituted the context. Then it can just be


context != DECL_CONTEXT (gen_tmpl)

no?

Jason


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