Patch to build visible conversion function list lazily and make its 
first use in calling the conversion function on delete statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81576 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index edf51ca..c6147ef 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -736,11 +736,11 @@
     QualType Type = Ex->getType();
 
     if (const RecordType *Record = Type->getAs<RecordType>()) {
-      // FIXME: Inherited conversion functions!
       llvm::SmallVector<CXXConversionDecl *, 4> ObjectPtrConversions;
+      CXXRecordDecl *RD = cast<CXXRecordDecl>(Record->getDecl());
+      OverloadedFunctionDecl *Conversions = 
+        RD->getVisibleConversionFunctions(Context, RD);
       
-      OverloadedFunctionDecl *Conversions
-        = cast<CXXRecordDecl>(Record->getDecl())->getConversionFunctions();
       for (OverloadedFunctionDecl::function_iterator
              Func = Conversions->function_begin(),
              FuncEnd = Conversions->function_end();