[Bug c++/13657] Error message incorrectly describes return type as argument type
manu at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jan 26 23:48:00 GMT 2007
------- Comment #2 from manu at gcc dot gnu dot org 2007-01-26 23:47 -------
(In reply to comment #0)
> The error message is basically correct, but there is no `argument' here. The
> error message should refer to the return type instead. It might suffice to
> simply replace the word `argument' with the word `return'.
It is not that easy. The function that emits the error seems to be used for
several things. However, at the point that the error is issued, I don't see any
way to detect what we are actually doing.
What do you think about this message? Will it work for any situation?
error: ÂC::bar of type Âint (C::)() does not match expected type Âint (*)()Â
The patch would be something like:
- error ("argument of type %qT does not match %qT", TREE_TYPE (rhs), lhstype);
+ error ("%qE of type %qT does not match expected type %qT", rhs,
TREE_TYPE(rhs), lhstype)
Andrew? Gabriel? Ian?
I can implement it and test it if you agree.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13657
More information about the Gcc-bugs
mailing list