<div class="gmail_quote">On Thu, Mar 10, 2011 at 9:27 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Thu, Mar 10, 2011 at 11:56 PM, Rafael Espindola<br>
<<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> Author: rafael<br>
> Date: Thu Mar 10 22:56:58 2011<br>
> New Revision: 127460<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=127460&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=127460&view=rev</a><br>
> Log:<br>
> Fix PR9453 by not trying to print a warning about ignored qualifiers<br>
> in conversion functions.<br>
><br>
> Modified:<br>
> cfe/trunk/lib/Sema/SemaType.cpp<br>
> cfe/trunk/test/SemaCXX/return.cpp<br>
><br>
> Modified: cfe/trunk/lib/Sema/SemaType.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=127460&r1=127459&r2=127460&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=127460&r1=127459&r2=127460&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/SemaType.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/SemaType.cpp Thu Mar 10 22:56:58 2011<br>
> @@ -1757,6 +1757,7 @@<br>
> // cv-qualifiers on return types are pointless except when the type is a<br>
> // class type in C++.<br>
> if (isa<PointerType>(T) && T.getLocalCVRQualifiers() &&<br>
> + (D.getName().getKind() != UnqualifiedId::IK_ConversionFunctionId) &&<br>
> (!getLangOptions().CPlusPlus || !T->isDependentType())) {<br>
> assert(chunkIndex + 1 < e && "No DeclaratorChunk for the return type?");<br>
> DeclaratorChunk ReturnTypeChunk = D.getTypeObject(chunkIndex + 1);<br>
><br>
> Modified: cfe/trunk/test/SemaCXX/return.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return.cpp?rev=127460&r1=127459&r2=127460&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return.cpp?rev=127460&r1=127459&r2=127460&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/SemaCXX/return.cpp (original)<br>
> +++ cfe/trunk/test/SemaCXX/return.cpp Thu Mar 10 22:56:58 2011<br>
> @@ -49,3 +49,7 @@<br>
> const PCHAR GetName() { return 0; } // expected-warning{{'const' type qualifier on return type has no effect}}<br>
> };<br>
> }<br>
> +<br>
> +class foo {<br>
> + operator int * const ();<br>
> +};<br>
<br>
</div></div>Is there some reason we don't want to warn here? Or is this just a<br>
quick hack for 2.9?</blockquote></div><br><div>If we want to warn on extraneous qualifiers for conversions functions, I feel like that should be a separate warning tailored to the situation. Calling it a 'return type' is a bit confusing.</div>