From 4fc7ab364110d6ad1c10dd38dbeb0597fed7e2f5 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 28 Aug 2009 15:11:24 +0000 Subject: 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 --- lib/CodeGen/CGExpr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 0d45ce9185..24442c3a73 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1172,6 +1172,11 @@ LValue CodeGenFunction::EmitConditionalOperator(const ConditionalOperator* E) { /// all the reasons that casts are permitted with aggregate result, including /// noop aggregate casts, and cast from scalar to union. LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { + if (E->getCastKind() == CastExpr::CK_UserDefinedConversion) { + const CXXFunctionalCastExpr *CXXFExpr = cast(E); + return LValue::MakeAddr(EmitCXXFunctionalCastExpr(CXXFExpr).getScalarVal(), 0); + } + // If this is an aggregate-to-aggregate cast, just use the input's address as // the lvalue. if (E->getCastKind() == CastExpr::CK_NoOp) -- cgit v1.2.3