This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13657] Error message incorrectly describes return type as argument type
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2007 23:47:50 -0000
- Subject: [Bug c++/13657] Error message incorrectly describes return type as argument type
- References: <bug-13657-1313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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