[cfe-commits] r127460 - in /cfe/trunk: lib/Sema/SemaType.cpp test/SemaCXX/return.cpp
Rafael Avila de Espindola
rafael.espindola at gmail.com
Fri Mar 11 08:49:59 PST 2011
> It's not redundant in the sense that you can omit it to create an equivalent
> program. It's redundant with regard to the return value it yields.
>
> If you do "&foo::operator int *const", then you get a "int * const(foo::*)
> ()". If you remove the "const", then you get a "int*(foo::*)()". Meaning, it
> *does* affect the type/return type of the conversion function (as is the
> case for other functions too).
>
> However, calling it will yield an rvalue of type "int*", therefor it won't
> change the type of a function call. Maybe warning "'const' type qualifier
> has no effect on function return value" would be more accurate, even if
> still (IMO) slightly ambiguous.
OK, I agree we should warn and that we probably need a special wording
for conversion functions. I will open a bug.
Cheers,
Rafael
More information about the cfe-commits
mailing list