aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-13 18:10:35 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-13 18:10:35 +0000
commitee697e69a2063b65bfd0534248e4848461aca3f4 (patch)
treeb25eb10f27dc58fa87188115c16a38d5885734a7 /lib/Sema/Sema.cpp
parent2f7aa998c0d6494301c12c4fceb6134a1bc248ab (diff)
Allow calling an overloaded function set by taking the address of the
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 2cb9275681..7b9f5909d1 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -894,10 +894,8 @@ bool Sema::isExprCallable(const Expr &E, QualType &ZeroArgCallReturnTy,
}
}
- // Ignore overloads where the address is taken, because apparently
- // overload resolution doesn't apply in these cases. In theory,
- // this can make us miss a few cases, but whatever.
- if (FR.IsAddressOfOperand)
+ // Ignore overloads that are the pointer-to-member.
+ if (FR.IsAddressOfOperand && FR.HasFormOfMemberPointer)
return false;
return true;