summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-31 20:58:29 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-31 20:58:29 +0000
commit17075f13d32c5ea825bb180e85950eeb9a27f55e (patch)
treea7eb204beebfc59d90675d0ed35447f9467c1b56
parent2fc41e3cccb507715a6e6934016a2f4337d114de (diff)
downloadppe42-gcc-17075f13d32c5ea825bb180e85950eeb9a27f55e.tar.gz
ppe42-gcc-17075f13d32c5ea825bb180e85950eeb9a27f55e.zip
in gcc/
2007-05-31 Daniel Berlin <dberlin@dberlin.org> * c-typeck.c (build_indirect_ref): Include type in error message. (build_binary_op): Pass types to binary_op_error. * c-common.c (binary_op_error): Take two type arguments, print out types with error. * c-common.h (binary_op_error): Update prototype. In gcc/cp 2007-05-31 Daniel Berlin <dberlin@dberlin.org> * typeck.c (build_binary_op): Include types in error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125239 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/c-common.c7
-rw-r--r--gcc/c-common.h2
-rw-r--r--gcc/c-typeck.c6
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/typeck.c2
6 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a518e5b86a2..404db9b75c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-31 Daniel Berlin <dberlin@dberlin.org>
+
+ * c-typeck.c (build_indirect_ref): Include type in error message.
+ (build_binary_op): Pass types to binary_op_error.
+ * c-common.c (binary_op_error): Take two type arguments, print out
+ types with error.
+ * c-common.h (binary_op_error): Update prototype.
+
2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c: Correct coments on -mno-sse4.
@@ -75,6 +83,7 @@
* gcc.c (main): Don't consider linker options when issuing the
warning about a linker input file not being used.
+>>>>>>> .r125234
2007-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tree-vrp.c (compare_names): Initialize sop.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 2edf807e91d..2d893ff1c78 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2233,10 +2233,10 @@ min_precision (tree value, int unsignedp)
}
/* Print an error message for invalid operands to arith operation
- CODE. */
+ CODE with TYPE0 for operand 0, and TYPE1 for operand 1. */
void
-binary_op_error (enum tree_code code)
+binary_op_error (enum tree_code code, tree type0, tree type1)
{
const char *opname;
@@ -2287,7 +2287,8 @@ binary_op_error (enum tree_code code)
default:
gcc_unreachable ();
}
- error ("invalid operands to binary %s", opname);
+ error ("invalid operands to binary %s (have %qT and %qT)", opname,
+ type0, type1);
}
/* Subroutine of build_binary_op, used for comparison operations.
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 71a958db93a..c60ce562a38 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -677,7 +677,7 @@ extern tree c_sizeof_or_alignof_type (tree, bool, int);
extern tree c_alignof_expr (tree);
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
-extern void binary_op_error (enum tree_code);
+extern void binary_op_error (enum tree_code, tree, tree);
extern tree fix_string_type (tree);
struct varray_head_tag;
extern void constant_expression_warning (tree);
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index a4eed3fe369..121febaaa1b 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1923,7 +1923,7 @@ build_indirect_ref (tree ptr, const char *errorstring)
}
}
else if (TREE_CODE (pointer) != ERROR_MARK)
- error ("invalid type argument of %qs", errorstring);
+ error ("invalid type argument of %qs (have %qT)", errorstring, type);
return error_mark_node;
}
@@ -8138,7 +8138,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|| !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
TREE_TYPE (type1))))
{
- binary_op_error (code);
+ binary_op_error (code, type0, type1);
return error_mark_node;
}
@@ -8438,7 +8438,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (!result_type)
{
- binary_op_error (code);
+ binary_op_error (code, TREE_TYPE (op0), TREE_TYPE (op1));
return error_mark_node;
}
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fe25b5de6e8..ea352c91383 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-31 Daniel Berlin <dberlin@dberlin.org>
+
+ * typeck.c (build_binary_op): Include types in error.
+
2007-05-31 Jakub Jelinek <jakub@redhat.com>
PR c++/31806
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 5712ba810c1..4219e69433e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3556,7 +3556,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|| !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
TREE_TYPE (type1)))
{
- binary_op_error (code);
+ binary_op_error (code, type0, type1);
return error_mark_node;
}
arithmetic_types_p = 1;
OpenPOWER on IntegriCloud