<div dir="ltr">Thanks Eli.  Committed at r188112.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 9, 2013 at 10:17 AM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">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 class="HOEnZb"><div class="h5">On Mon, Aug 5, 2013 at 8:44 PM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>

> Author: rtrieu<br>
> Date: Mon Aug  5 22:44:10 2013<br>
> New Revision: 187769<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=187769&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=187769&view=rev</a><br>
> Log:<br>
> Fix for PR16570: when comparing two function pointers, discard qualifiers when<br>
> comparing non-reference function parameters.  The qualifiers don't matter for<br>
> comparisons.<br>
><br>
> Added:<br>
>     cfe/trunk/test/SemaCXX/function-pointer-arguments.cpp<br>
> Modified:<br>
>     cfe/trunk/lib/Sema/SemaOverload.cpp<br>
><br>
> Modified: cfe/trunk/lib/Sema/SemaOverload.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=187769&r1=187768&r2=187769&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=187769&r1=187768&r2=187769&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/SemaOverload.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/SemaOverload.cpp Mon Aug  5 22:44:10 2013<br>
> @@ -2584,9 +2584,17 @@ bool Sema::FunctionArgTypesAreEqual(cons<br>
>    for (FunctionProtoType::arg_type_iterator O = OldType->arg_type_begin(),<br>
>         N = NewType->arg_type_begin(),<br>
>         E = OldType->arg_type_end(); O && (O != E); ++O, ++N) {<br>
> -    if (!Context.hasSameType(*O, *N)) {<br>
> -      if (ArgPos) *ArgPos = O - OldType->arg_type_begin();<br>
> -      return false;<br>
> +    if (!(*O)->isReferenceType() && !(*N)->isReferenceType()) {<br>
> +      if (!Context.hasSameType(O->getUnqualifiedType(),<br>
> +                               N->getUnqualifiedType())) {<br>
> +        if (ArgPos) *ArgPos = O - OldType->arg_type_begin();<br>
> +        return false;<br>
> +      }<br>
> +    } else {<br>
> +      if (!Context.hasSameType(*O, *N)) {<br>
> +        if (ArgPos) *ArgPos = O - OldType->arg_type_begin();<br>
> +        return false;<br>
> +      }<br>
<br>
</div></div>These two branches do the same thing because reference types are never<br>
qualified.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br></div>