Commit 153ae66a by Dirk Mueller Committed by Dirk Mueller

re PR c++/29089 (Words substituted for %s in a sentence can not be translated)

       PR c++/29089
       * typeck.c (build_unary_op): Duplicate warning message
       for easier translation.

From-SVN: r118156
parent 180550a8
2006-10-29 Dirk Mueller <dmueller@suse.de> 2006-10-29 Dirk Mueller <dmueller@suse.de>
PR c++/29089
* typeck.c (build_unary_op): Duplicate warning message
for easier translation.
2006-10-29 Dirk Mueller <dmueller@suse.de>
PR c++/16307 PR c++/16307
* typeck.c (build_array_ref): Warn for char subscriptions * typeck.c (build_array_ref): Warn for char subscriptions
on pointers. on pointers.
......
...@@ -4121,9 +4121,9 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) ...@@ -4121,9 +4121,9 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
/* ARM $5.2.5 last annotation says this should be forbidden. */ /* ARM $5.2.5 last annotation says this should be forbidden. */
if (TREE_CODE (argtype) == ENUMERAL_TYPE) if (TREE_CODE (argtype) == ENUMERAL_TYPE)
pedwarn ("ISO C++ forbids %sing an enum", pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) ?
(code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) "ISO C++ forbids incrementing an enum" :
? "increment" : "decrement"); "ISO C++ forbids decrementing an enum");
/* Compute the increment. */ /* Compute the increment. */
...@@ -4132,16 +4132,20 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) ...@@ -4132,16 +4132,20 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
tree type = complete_type (TREE_TYPE (argtype)); tree type = complete_type (TREE_TYPE (argtype));
if (!COMPLETE_OR_VOID_TYPE_P (type)) if (!COMPLETE_OR_VOID_TYPE_P (type))
error ("cannot %s a pointer to incomplete type %qT", error (((code == PREINCREMENT_EXPR
((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR))
|| code == POSTINCREMENT_EXPR) ?
? "increment" : "decrement"), TREE_TYPE (argtype)); "cannot increment a pointer to incomplete type %qT" :
"cannot decrement a pointer to incomplete type %qT",
TREE_TYPE (argtype));
else if ((pedantic || warn_pointer_arith) else if ((pedantic || warn_pointer_arith)
&& !TYPE_PTROB_P (argtype)) && !TYPE_PTROB_P (argtype))
pedwarn ("ISO C++ forbids %sing a pointer of type %qT", pedwarn (((code == PREINCREMENT_EXPR
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR) || code == POSTINCREMENT_EXPR)
? "increment" : "decrement"), argtype); ?
"ISO C++ forbids incrementing a pointer of type %qT" :
"ISO C++ forbids decrementing a pointer of type %qT"),
argtype);
inc = cxx_sizeof_nowarn (TREE_TYPE (argtype)); inc = cxx_sizeof_nowarn (TREE_TYPE (argtype));
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment