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] Fix PR c++/29727: ICE on invalid initializer for template member


> -      gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE);
> +      gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE
> +		  || (ce->index == error_mark_node));
>        error ("name %qD used in a GNU-style designated "
>  	     "initializer for an array", ce->index);

Hi Simon, this should be

  if (ce->index != error_mark_node)
    {
      gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE);
      error ("...");
    }
  return false;

otherwise you get a bogus error when ce->index is passed as a %qD.

Thanks!

Paolo


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