summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-06 02:19:58 +0000
committerpfg <pfg@FreeBSD.org>2013-12-06 02:19:58 +0000
commit681c6ef3ecabd11a13f4d291b100c0d036aa650f (patch)
tree79ad4332349324d8cef37f82064848496302c7d2 /contrib/gcc
parentf8a9c7a9ee55b09ea40c2b41421cada96ed40621 (diff)
downloadFreeBSD-src-681c6ef3ecabd11a13f4d291b100c0d036aa650f.zip
FreeBSD-src-681c6ef3ecabd11a13f4d291b100c0d036aa650f.tar.gz
gcc: Include types in error message for build_binary_op.
Mostly cosmetic change, again to reduce differences with Apple's gcc. Obtained from: gcc 4.3 (rev. 125239; GPLv2) MFC after: 3 weeks
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/ChangeLog.gcc438
-rw-r--r--contrib/gcc/c-common.c7
-rw-r--r--contrib/gcc/c-common.h2
-rw-r--r--contrib/gcc/c-typeck.c6
-rw-r--r--contrib/gcc/cp/ChangeLog.gcc434
-rw-r--r--contrib/gcc/cp/typeck.c2
6 files changed, 21 insertions, 8 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43
index 8311fc9..acb1ddc 100644
--- a/contrib/gcc/ChangeLog.gcc43
+++ b/contrib/gcc/ChangeLog.gcc43
@@ -57,6 +57,14 @@
operand.
(store_expr): Handle BLKmode moves by calling emit_block_move.
+2007-05-31 Daniel Berlin <dberlin@dberlin.org> (r125239)
+
+ * 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-27 Eric Christopher <echristo@apple.com> (r125116)
* config/rs6000/rs6000.c (rs6000_emit_prologue): Update
diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c
index d358a79..b97bb72 100644
--- a/contrib/gcc/c-common.c
+++ b/contrib/gcc/c-common.c
@@ -2019,10 +2019,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;
@@ -2073,7 +2073,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/contrib/gcc/c-common.h b/contrib/gcc/c-common.h
index fb9ea9e..8848ea5 100644
--- a/contrib/gcc/c-common.h
+++ b/contrib/gcc/c-common.h
@@ -654,7 +654,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/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c
index 3e47837..dd59620 100644
--- a/contrib/gcc/c-typeck.c
+++ b/contrib/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;
}
@@ -8135,7 +8135,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;
}
@@ -8431,7 +8431,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/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43
index 24e79ee..caf9dd2 100644
--- a/contrib/gcc/cp/ChangeLog.gcc43
+++ b/contrib/gcc/cp/ChangeLog.gcc43
@@ -18,6 +18,10 @@
* decl2.c (determine_visibility): Remove duplicate code for
handling type info.
+2007-05-31 Daniel Berlin <dberlin@dberlin.org> (r125239)
+
+ * typeck.c (build_binary_op): Include types in error.
+
2007-05-05 Geoffrey Keating <geoffk@apple.com> (r124467)
PR 31775
diff --git a/contrib/gcc/cp/typeck.c b/contrib/gcc/cp/typeck.c
index d0334dd..34a301d 100644
--- a/contrib/gcc/cp/typeck.c
+++ b/contrib/gcc/cp/typeck.c
@@ -3476,7 +3476,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