diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-28 15:11:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-28 15:11:24 +0000 |
commit | 4fc7ab364110d6ad1c10dd38dbeb0597fed7e2f5 (patch) | |
tree | 7123cf844cf6971d011973cfa5775bf6f6bb5229 /lib/Sema/SemaCXXCast.cpp | |
parent | 7e8f8189d0876e03ebc5018f6a22e41f5aaa20d9 (diff) |
ir-gen related patch for type conversion
with class type conversion methods. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index b07635779b..b528cc421f 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -776,17 +776,6 @@ TryStaticImplicitCast(Sema &Self, Expr *SrcExpr, QualType DestType, msg = 0; return TC_Failed; } - if (DestType->isRecordType()) { - // There are no further possibilities for the target type being a class, - // neither in static_cast nor in a C-style cast. So we can fail here. - if ((ConversionDecl = - Self.PerformInitializationByConstructor(DestType, &SrcExpr, 1, - OpRange.getBegin(), OpRange, DeclarationName(), Sema::IK_Direct))) - return TC_Success; - // The function already emitted an error. - msg = 0; - return TC_Failed; - } // FIXME: To get a proper error from invalid conversions here, we need to // reimplement more of this. @@ -799,9 +788,9 @@ TryStaticImplicitCast(Sema &Self, Expr *SrcExpr, QualType DestType, /*ForceRValue=*/false); if (ICS.ConversionKind == ImplicitConversionSequence::UserDefinedConversion) - if (CXXConversionDecl *CV = - dyn_cast<CXXConversionDecl>(ICS.UserDefined.ConversionFunction)) - ConversionDecl = CV; + if (CXXMethodDecl *MD = + dyn_cast<CXXMethodDecl>(ICS.UserDefined.ConversionFunction)) + ConversionDecl = MD; return ICS.ConversionKind == ImplicitConversionSequence::BadConversion ? TC_NotApplicable : TC_Success; } |