This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Translation error
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: Translation error
- From: Dennis Bjorklund <db at zigo dot dhs dot org>
- Date: Sun, 27 May 2001 12:29:34 +0200 (CEST)
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. */