From: Jason Merrill Date: Tue, 14 Jun 2011 18:16:06 +0000 (-0400) Subject: re PR c++/49117 (4.5 -> 4.6: user-unfriendly change in "invalid conversion" error... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84f32ce3b24cd508e9a4b3b4d716ab7fc293fba1;p=gcc.git re PR c++/49117 (4.5 -> 4.6: user-unfriendly change in "invalid conversion" error message) PR c++/49117 * call.c (perform_implicit_conversion_flags): Print source type as well as expression. From-SVN: r175044 --- 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 + 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 + * 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 .\\. to .bool." } + if (throw 0) // { dg-error "could not convert .\\. from .void. to .bool." } ; }