diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-30 15:53:26 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-30 15:53:26 +0000 |
commit | 2cd7f41f4eb2b02568664132253f8e1d9cf381dd (patch) | |
tree | 6ae15806f5a6513448d19a21f20d979acc7efa7f /lib/AST/DeclCXX.cpp | |
parent | 6cc9dc8403c4a8838f4f932e43402090cfe70d98 (diff) |
Fix ambiguity detection in GetBestOverloadCandidateSimple.
When performing the simplistic overload resolution for single-argument methods,
don't check the best overload for ambiguity with itself when the best overload
doesn't happen to be the first one.
Fixes PR13480.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160961 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclCXX.cpp')
-rw-r--r-- | lib/AST/DeclCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 217b27a8d1..eec2e9d3cf 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -344,8 +344,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; |