Thanks Eli. Committed at r188112.
On Fri, Aug 9, 2013 at 10:17 AM, Eli Friedman <[email protected]>wrote: > On Mon, Aug 5, 2013 at 8:44 PM, Richard Trieu <[email protected]> wrote: > > Author: rtrieu > > Date: Mon Aug 5 22:44:10 2013 > > New Revision: 187769 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=187769&view=rev > > Log: > > Fix for PR16570: when comparing two function pointers, discard > qualifiers when > > comparing non-reference function parameters. The qualifiers don't > matter for > > comparisons. > > > > Added: > > cfe/trunk/test/SemaCXX/function-pointer-arguments.cpp > > Modified: > > cfe/trunk/lib/Sema/SemaOverload.cpp > > > > Modified: cfe/trunk/lib/Sema/SemaOverload.cpp > > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=187769&r1=187768&r2=187769&view=diff > > > ============================================================================== > > --- cfe/trunk/lib/Sema/SemaOverload.cpp (original) > > +++ cfe/trunk/lib/Sema/SemaOverload.cpp Mon Aug 5 22:44:10 2013 > > @@ -2584,9 +2584,17 @@ bool Sema::FunctionArgTypesAreEqual(cons > > for (FunctionProtoType::arg_type_iterator O = > OldType->arg_type_begin(), > > N = NewType->arg_type_begin(), > > E = OldType->arg_type_end(); O && (O != E); ++O, ++N) { > > - if (!Context.hasSameType(*O, *N)) { > > - if (ArgPos) *ArgPos = O - OldType->arg_type_begin(); > > - return false; > > + if (!(*O)->isReferenceType() && !(*N)->isReferenceType()) { > > + if (!Context.hasSameType(O->getUnqualifiedType(), > > + N->getUnqualifiedType())) { > > + if (ArgPos) *ArgPos = O - OldType->arg_type_begin(); > > + return false; > > + } > > + } else { > > + if (!Context.hasSameType(*O, *N)) { > > + if (ArgPos) *ArgPos = O - OldType->arg_type_begin(); > > + return false; > > + } > > These two branches do the same thing because reference types are never > qualified. > > -Eli >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
