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]

Translation error


Ugly hack used to create an error string that does not
work for all languages. The patch speaks for itself.

-- 
/Dennis
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.337.2.5
diff -u -w -r1.337.2.5 typeck.c
--- typeck.c	2001/05/12 10:43:19	1.337.2.5
+++ typeck.c	2001/05/27 10:23:48
@@ -4517,10 +4517,12 @@
 	argtype = TREE_TYPE (arg);
 
 	/* 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");
+	if (TREE_CODE (argtype) == ENUMERAL_TYPE) {
+	  if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
+	    pedwarn ("ISO C++ forbids incrementing an enum");
+	  else
+	    pedwarn ("ISO C++ forbids decrementing an enum");
+	}
 	    
 	/* Compute the increment.  */
 

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