http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59032

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #2 from vries at gcc dot gnu.org ---
Tentative patch:
...
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bcb8782..8566e58 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5665,7 +5665,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, int
noconvert,

       /* Report invalid types.  */

-      if (!(arg = build_expr_type_conversion (WANT_ARITH | WANT_POINTER,
+      if (!(arg = build_expr_type_conversion (WANT_INT | WANT_FLOAT
+                                             | WANT_POINTER,
                          arg, true)))
    {
      if (code == PREINCREMENT_EXPR)
...

WANT_ARITH is defined as:
...
#define WANT_ARITH      (WANT_INT | WANT_FLOAT | WANT_VECTOR_OR_COMPLEX)
...
so the patch effectively removes WANT_VECTOR_OR_COMPLEX. AFAIU the COMPLEX case
is already handled at this point, so there shouldn't be any effect for those.

This patch brings back the old error message:
...
test.c: In function ‘void foo()’:
test.c:4:5: error: no pre-increment operator for type
   ++v;
     ^
...

Reply via email to