aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-19 15:37:02 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-19 15:37:02 +0000
commitbca393259bc01955b334709de0f5a202470f913a (patch)
tree0bfa41923b46361786bcb144e305ea03510c6c35 /lib/Sema/SemaOverload.cpp
parenta4f235b7cab8ca3132b353470ad0fbbce5b5499a (diff)
Include a proper citation for the wacky hijinks involving conversion functions and the implicit object parameter type. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111519 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 694975546c..2ee36f8101 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -3749,9 +3749,11 @@ Sema::AddConversionCandidate(CXXConversionDecl *Conversion,
Candidate.Conversions[0]
= TryObjectArgumentInitialization(From->getType(), Conversion,
ActingContext);
- // Conversion functions to a different type in the base class is visible in
- // the derived class. So, a derived to base conversion should not participate
- // in overload resolution.
+
+ // C++ [over.match.funcs]p4:
+ // For conversion functions, the function is considered to be a member of
+ // the class of the implicit implied object argument for the purpose of
+ // defining the type of the implicit object parameter.
if (Candidate.Conversions[0].Standard.Second == ICK_Derived_To_Base)
Candidate.Conversions[0].Standard.Second = ICK_Identity;
if (Candidate.Conversions[0].isBad()) {