aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2007-02-15 22:15:20 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2007-02-15 22:15:20 +0000
commit214931020be4420e7a5eb537813dc918b9cada58 (patch)
treef7d6b79b1f01e65516552fe5cb37e658943bad5f /gcc/cp
parentf173837aade126f9e3185425ab4c9fca7f7345dd (diff)
downloadgcc-214931020be4420e7a5eb537813dc918b9cada58.zip
gcc-214931020be4420e7a5eb537813dc918b9cada58.tar.gz
gcc-214931020be4420e7a5eb537813dc918b9cada58.tar.bz2
re PR c++/28943 (Unusable error message when using a conditional-expression with multiple type arguments)
2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/28943 cp/ * call.c (build_conditional_expr): Improve error message. testsuite/ * g++.dg/warn/pr28943.C: New. From-SVN: r122016
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 342a7ba..fd068e4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/28943
+ * call.c (build_conditional_expr): Improve error message.
+
2007-02-13 Dirk Mueller <dmueller@suse.de>
* friend.c (do_friend): Annotate warning about friend
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ac29ecd..6690fa2 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3281,8 +3281,16 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
result_type = void_type_node;
else
{
- error ("%qE has type %<void%> and is not a throw-expression",
- VOID_TYPE_P (arg2_type) ? arg2 : arg3);
+ if (VOID_TYPE_P (arg2_type))
+ error ("second operand to the conditional operator "
+ "is of type %<void%>, "
+ "but the third operand is neither a throw-expression "
+ "nor of type %<void%>");
+ else
+ error ("third operand to the conditional operator "
+ "is of type %<void%>, "
+ "but the second operand is neither a throw-expression "
+ "nor of type %<void%>");
return error_mark_node;
}