[cfe-commits] r111519 - /cfe/trunk/lib/Sema/SemaOverload.cpp
Douglas Gregor
dgregor at apple.com
Thu Aug 19 08:37:02 PDT 2010
Author: dgregor
Date: Thu Aug 19 10:37:02 2010
New Revision: 111519
URL: http://llvm.org/viewvc/llvm-project?rev=111519&view=rev
Log:
Include a proper citation for the wacky hijinks involving conversion functions and the implicit object parameter type. No functionality change.
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=111519&r1=111518&r2=111519&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Aug 19 10:37:02 2010
@@ -3749,9 +3749,11 @@
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()) {
More information about the cfe-commits
mailing list