From: Mandeep Singh Grang Date: Tue, 14 Nov 2017 00:22:24 +0000 (+0000) Subject: [Sema] Stable sort OverloadCandidates to remove non-deterministic ordering X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7441744469624f0afc99d4fa78cb30755c242794;p=clang [Sema] Stable sort OverloadCandidates to remove non-deterministic ordering Summary: This fixes failure in Misc/diag-template-diffing.cpp uncovered by D39245. Reviewers: rjmccall, rsmith Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39944 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318121 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 56135288db..f4b8b4e34a 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -10516,7 +10516,7 @@ void OverloadCandidateSet::NoteCandidates( } } - std::sort(Cands.begin(), Cands.end(), + std::stable_sort(Cands.begin(), Cands.end(), CompareOverloadCandidatesForDisplay(S, OpLoc, Args.size(), Kind)); bool ReportedAmbiguousConversions = false;