diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-26 20:34:58 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-26 20:34:58 +0000 |
| commit | d79d5053bd1ab061dabf4ffa1f7ab55e0a3106e0 (patch) | |
| tree | dec8651928a2f1eedb35cbbf01a296e752c5dc9c /clang/lib/Sema/SemaExprCXX.cpp | |
| parent | a3063cec1478b0d276e9c27f1484c23b4386c3ce (diff) | |
| download | bcm5719-llvm-d79d5053bd1ab061dabf4ffa1f7ab55e0a3106e0.tar.gz bcm5719-llvm-d79d5053bd1ab061dabf4ffa1f7ab55e0a3106e0.zip | |
AST for conversion by conversion functions. WIP.
llvm-svn: 80135
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 2b0749aec02..ae5010cfac3 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -216,9 +216,10 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep, return ExprError(); exprs.release(); return Owned(new (Context) CXXFunctionalCastExpr(Ty.getNonReferenceType(), - Ty, TyBeginLoc, Kind, - Exprs[0], ConversionDecl, - RParenLoc)); + Ty, TyBeginLoc, + CastExpr::CK_UserDefinedConversion, + Exprs[0], ConversionDecl, + RParenLoc)); } if (const RecordType *RT = Ty->getAs<RecordType>()) { @@ -906,9 +907,16 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, break; case ImplicitConversionSequence::UserDefinedConversion: - // FIXME: This is, of course, wrong. We'll need to actually call the - // constructor or conversion operator, and then cope with the standard - // conversions. + // FIXME. Support other kinds of user defined convesions. + if (CXXConversionDecl *CV = + dyn_cast<CXXConversionDecl>(ICS.UserDefined.ConversionFunction)) + // FIXME. Get actual Source Location. + From = + new (Context) CXXFunctionalCastExpr(ToType.getNonReferenceType(), + ToType, SourceLocation(), + CastExpr::CK_UserDefinedConversion, + From, CV, + SourceLocation()); ImpCastExprToType(From, ToType.getNonReferenceType(), CastExpr::CK_Unknown, ToType->isLValueReferenceType()); |

