From 8b899e424718788712fe10a42fde919ff3bc0362 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. llvm-svn: 80365 --- clang/lib/Sema/SemaExprCXX.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaExprCXX.cpp') diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index cdda6ab32ff..061ac8d2c33 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -228,12 +228,15 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep, if (CheckCastTypes(TypeRange, Ty, Exprs[0], Kind, ConversionDecl, /*functional-style*/true)) return ExprError(); - exprs.release(); - return Owned(new (Context) CXXFunctionalCastExpr(Ty.getNonReferenceType(), + // We done't build this AST for X(i) where we are constructing an object. + if (!ConversionDecl || !isa(ConversionDecl)) { + exprs.release(); + return Owned(new (Context) CXXFunctionalCastExpr(Ty.getNonReferenceType(), Ty, TyBeginLoc, CastExpr::CK_UserDefinedConversion, Exprs[0], ConversionDecl, RParenLoc)); + } } if (const RecordType *RT = Ty->getAs()) { -- cgit v1.2.3