Commit c3c1f2b7 by Paolo Carlini Committed by Paolo Carlini

re PR c++/13657 (Error message incorrectly describes return type as argument type)

/cp
2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/13657
	* class.c (instantiate_type): Fix error message.

/testsuite
2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/13657
	* g++.dg/parse/error42.C: New.
	* g++.old-deja/g++.other/ptrmem7.C: Tweak dg-errors.

From-SVN: r180228
parent 875bcfdb
2011-10-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/13657
* class.c (instantiate_type): Fix error message.
2011-10-19 Jason Merrill <jason@redhat.com>
PR c++/50793
......
......@@ -6867,8 +6867,8 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
else
{
if (flags & tf_error)
error ("argument of type %qT does not match %qT",
TREE_TYPE (rhs), lhstype);
error ("cannot convert %qE from type %qT to type %qT",
rhs, TREE_TYPE (rhs), lhstype);
return error_mark_node;
}
}
......
2011-10-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/13657
* g++.dg/parse/error42.C: New.
* g++.old-deja/g++.other/ptrmem7.C: Tweak dg-errors.
2011-10-19 Jason Merrill <jason@redhat.com>
PR c++/50793
......
// PR c++/13657
class C { public: int (*f())(); int bar(); };
int (*C::f())() { return C::bar; } // { dg-error "cannot convert 'C::bar'" }
......@@ -31,9 +31,9 @@ void A::foo ()
int (*ptr8) (short) = ns;
int (A::*ptr11) (int) = &A::single;
int (A::*ptr12) (int) = A::single; // { dg-error "match" }
int (A::*ptr12) (int) = A::single; // { dg-error "cannot convert" }
int (A::*ptr13) (int) = &single; // { dg-error "pointer to member" }
int (A::*ptr14) (int) = single; // { dg-error "match" }
int (A::*ptr14) (int) = single; // { dg-error "cannot convert" }
int (A::*ptr20) (int) = &(A::ns); // { dg-error "pointer to member" }
int (A::*ptr21) (int) = &(A::single); // { dg-error "pointer to member" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment