summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-14 18:16:06 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-14 18:16:06 +0000
commita37cbb818ad33c7955a5bcff2dc8e68c273e55a8 (patch)
tree1bec61d23d54c85bd66a6080029c5dcb69f18d45
parent0277b639978dd399114465befd4000016f53526e (diff)
downloadgcc-a37cbb818ad33c7955a5bcff2dc8e68c273e55a8.tar.gz
PR c++/49117
* call.c (perform_implicit_conversion_flags): Print source type as well as expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175044 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/other/error23.C2
-rw-r--r--gcc/testsuite/g++.dg/other/error32.C2
5 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5970440731f..0fc8eab5e8b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2011-06-14 Jason Merrill <jason@redhat.com>
+ PR c++/49117
+ * call.c (perform_implicit_conversion_flags): Print source type as
+ well as expression.
+
PR c++/49389
* typeck2.c (build_m_component_ref): Preserve rvalueness.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4ee0eafe81d..b43d078dedd 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -8296,7 +8296,8 @@ perform_implicit_conversion_flags (tree type, tree expr, tsubst_flags_t complain
else if (invalid_nonstatic_memfn_p (expr, complain))
/* We gave an error. */;
else
- error ("could not convert %qE to %qT", expr, type);
+ error ("could not convert %qE from %qT to %qT", expr,
+ TREE_TYPE (expr), type);
}
expr = error_mark_node;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1ca37e3490d..e32f53ea3ac 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2011-06-14 Jason Merrill <jason@redhat.com>
+ * g++.dg/other/error23.C: Adjust error message.
+ * g++.dg/other/error32.C: Likewise.
+
PR c++/49389
* g++.dg/cpp0x/rv-dotstar.C: New.
diff --git a/gcc/testsuite/g++.dg/other/error23.C b/gcc/testsuite/g++.dg/other/error23.C
index 0ff1915cf2c..959fe4075e6 100644
--- a/gcc/testsuite/g++.dg/other/error23.C
+++ b/gcc/testsuite/g++.dg/other/error23.C
@@ -2,4 +2,4 @@
// { dg-do compile }
int v __attribute ((vector_size (8)));
-bool b = !(v - v); // { dg-error "could not convert .\\(__vector.2. int\\)\\{0, 0\\}. to .bool.|in argument to unary" }
+bool b = !(v - v); // { dg-error "could not convert .\\(__vector.2. int\\)\\{0, 0\\}. from .__vector.2. int. to .bool.|in argument to unary" }
diff --git a/gcc/testsuite/g++.dg/other/error32.C b/gcc/testsuite/g++.dg/other/error32.C
index 35c64c4eab9..56d3b7aec8b 100644
--- a/gcc/testsuite/g++.dg/other/error32.C
+++ b/gcc/testsuite/g++.dg/other/error32.C
@@ -3,6 +3,6 @@
void foo()
{
- if (throw 0) // { dg-error "could not convert .\\<throw-expression\\>. to .bool." }
+ if (throw 0) // { dg-error "could not convert .\\<throw-expression\\>. from .void. to .bool." }
;
}