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++/26291: Diagnose invalid ellipsis in operator declaration


Volker Reichelt wrote:

> 	PR c++/26291
> 	* decl.c (grok_op_properties): Check for ellipsis in arguments of
>         operators.

> @@ -9022,6 +9024,9 @@ grok_op_properties (tree decl, bool comp
>  	}
>        else if (ambi_op_p (operator_code))
>  	{
> +	  if (ellipsis_p)
> +	    error ("arguments of %qD must not contain ellipsis", decl);

Rather that duplicating this code, let's pull it out into a (new) block
containing the various ambi_op_p/unary_op_p/binary_op_p tests.  Also, I
think it would be better not to issue both the ellipsis error and
additional arity errors, although that's a very minor point.

With that change, the patch is pre-approved for mainline and 4.0 branch,
and for 4.1 after the final 4.1 release.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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