This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22549] Differing error messages depending on thelocality of a variable
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2005 15:09:46 -0000
- Subject: [Bug c++/22549] Differing error messages depending on thelocality of a variable
- References: <20050718145831.22549.theodore.papadopoulo@sophia.inria.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-18 15:09 -------
I think the error message is fine for being different as there is no way to convert "const A" to char.
Take the following reduced testcase:
struct A {
A(const char&);
operator char(); /* We cannot use this with "const A". */
};
A f(A &a) {
return 1 ? a : -a; /* we are able to convert a to char as there is an operator. */
}
A g(const A& c) {
return 1 ? c : -c; /* unlike here because of above */
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22549