[PATCH, committed] PR c++/29089

Andreas Schwab schwab@suse.de
Sun Oct 29 21:54:00 GMT 2006


Dirk Mueller <dmuell@gmx.net> writes:

> --- typeck.c
> +++ typeck.c
> @@ -4121,9 +4121,9 @@ build_unary_op (enum tree_code code, tre
>  
>  	/* ARM $5.2.5 last annotation says this should be forbidden.  */
>  	if (TREE_CODE (argtype) == ENUMERAL_TYPE)
> -	  pedwarn ("ISO C++ forbids %sing an enum",
> -		   (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
> -		   ? "increment" : "decrement");
> +	  pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) ?
> +                   "ISO C++ forbids incrementing an enum" :
> +                   "ISO C++ forbids decrementing an enum");

That should be written like this:

	  pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
                   ? "ISO C++ forbids incrementing an enum"
                   : "ISO C++ forbids decrementing an enum");

Similarily for the other changes.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc-patches mailing list