Commit caba2081 by Paolo Carlini Committed by Paolo Carlini

re PR c++/22256 (diagnostic shows wrong type for conversion operator)

/cp
2007-08-10  Paolo Carlini  <pcarlini@suse.de>

	PR c++/22256
	* decl.c (check_special_function_return_type): Just error
	on return type specified for conversion operator.

/testsuite
2007-08-10  Paolo Carlini  <pcarlini@suse.de>

	PR c++/22256
	* g++.dg/conversion/op3.C: New.

From-SVN: r127331
parent d184f9d9
2007-08-10 Paolo Carlini <pcarlini@suse.de>
PR c++/22256
* decl.c (check_special_function_return_type): Just error
on return type specified for conversion operator.
2007-08-09 Daniel Berlin <dberlin@dberlin.org>
* typeck2.c (readonly_error): Handle general expressions.
......
......@@ -6993,10 +6993,8 @@ check_special_function_return_type (special_function_kind sfk,
break;
case sfk_conversion:
if (type && !same_type_p (type, optype))
error ("operator %qT declared to return %qT", optype, type);
else if (type)
pedwarn ("return type specified for %<operator %T%>", optype);
if (type)
error ("return type specified for %<operator %T%>", optype);
type = optype;
break;
......
2007-08-10 Paolo Carlini <pcarlini@suse.de>
PR c++/22256
* g++.dg/conversion/op3.C: New.
2007-08-09 Tobias Burnus <burnus@net-b.de>
PR fortran/32987
// PR c++/22256
struct node { int* operator int*(); }; // { dg-error "return type specified" }
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