]> granicus.if.org Git - clang/commitdiff
Include a proper citation for the wacky hijinks involving conversion functions and...
authorDouglas Gregor <dgregor@apple.com>
Thu, 19 Aug 2010 15:37:02 +0000 (15:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 19 Aug 2010 15:37:02 +0000 (15:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111519 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp

index 694975546cd50cf5bb1eb51eef37a20a9c00ab04..2ee36f810193191b2703a3ff8fc6cb14842c1137 100644 (file)
@@ -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()) {