aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-25 10:46:05 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-25 10:46:05 +0000
commit3a8133727659077d0c918226e5dad6c16c8274f6 (patch)
tree3ea7d3094476bc860e6f0880206a613741411366 /lib/Sema
parent78bd771b27d696d156899471303622fa51f52438 (diff)
When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't initialize it. Fixes PR6421, which is such a very straightforward extension of PR6398 that I should have worked it into the last test case (and therefore caught it then). Ah well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaOverload.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 7208b90939..cfb4b91996 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -4797,7 +4797,8 @@ struct CompareOverloadCandidatesForDisplay {
assert(L->Conversions.size() == R->Conversions.size());
int leftBetter = 0;
- for (unsigned I = 0, E = L->Conversions.size(); I != E; ++I) {
+ unsigned I = (L->IgnoreObjectArgument || R->IgnoreObjectArgument);
+ for (unsigned E = L->Conversions.size(); I != E; ++I) {
switch (S.CompareImplicitConversionSequences(L->Conversions[I],
R->Conversions[I])) {
case ImplicitConversionSequence::Better: