[PATCH] PR c++/43327

Jason Merrill jason@redhat.com
Wed Mar 24 14:49:00 GMT 2010


On 03/24/2010 05:44 AM, Dodji Seketeli wrote:
> +    case VAR_DECL:
> +      /* A non-type template parameter that is a variable should be a
> +         an integral constant, in which case, it whould have been
> +	 folded into its value. So we should not be getting a variable here.  */
> +      return 1;

Shouldn't this be gcc_unreachable() then?

> +	  tree tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
> +	  int i;
> +	  for (i = 0; i<  TREE_VEC_LENGTH (partial_spec_args); ++i)
> +	    {
> +	      TREE_VEC_ELT (partial_spec_args, i) =
> +		convert_template_argument (TREE_VALUE (TREE_VEC_ELT
> +							 (tmpl_parms, i)),
> +					   TREE_VEC_ELT (partial_spec_args, i),
> +					   partial_spec_args,
> +					   tf_none, i, NULL_TREE);
> +	    }

I suspect that this won't handle variadics properly.  How about just 
calling coerce_template_parms?

Jason



More information about the Gcc-patches mailing list