@@ -, +, @@ --- lib/AST/DeclCXX.cpp | 4 ++-- lib/Sema/SemaDecl.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) --- a/tools/clang/lib/AST/DeclCXX.cpp +++ a/tools/clang/lib/AST/DeclCXX.cpp @@ -359,8 +359,8 @@ GetBestOverloadCandidateSimple( if (Cands[Best].second.compatiblyIncludes(Cands[I].second)) Best = I; - for (unsigned I = 1; I != N; ++I) - if (Cands[Best].second.compatiblyIncludes(Cands[I].second)) + for (unsigned I = 0; I != N; ++I) + if (I != Best && Cands[Best].second.compatiblyIncludes(Cands[I].second)) return 0; return Cands[Best].first; --- a/tools/clang/lib/Sema/SemaDecl.cpp +++ a/tools/clang/lib/Sema/SemaDecl.cpp @@ -9213,10 +9213,9 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { case CXXCopyAssignment: if (RD->hasUserDeclaredCopyAssignment()) { - // FIXME: this should use the location of the copy - // assignment, not the type. - SourceLocation TyLoc = RD->getLocStart(); - Diag(TyLoc, diag::note_nontrivial_user_defined) << QT << member; + SourceLocation AssignLoc = + RD->getCopyAssignmentOperator(0)->getLocation(); + Diag(AssignLoc, diag::note_nontrivial_user_defined) << QT << member; return; } break; --