This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/22549] Differing error messages depending on thelocality of a variable


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]