summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-28 15:11:24 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-28 15:11:24 +0000
commit8b899e424718788712fe10a42fde919ff3bc0362 (patch)
tree8a00de81b306e09d81033461940c65a3c4001df7 /clang/lib/Sema/SemaExprCXX.cpp
parente8a5863c3f56ae3ab261598c788d94b56c977dcb (diff)
downloadbcm5719-llvm-8b899e424718788712fe10a42fde919ff3bc0362.tar.gz
bcm5719-llvm-8b899e424718788712fe10a42fde919ff3bc0362.zip
ir-gen related patch for type conversion
with class type conversion methods. WIP. llvm-svn: 80365
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp7
1 files changed, 5 insertions, 2 deletions
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<CXXConstructorDecl>(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<RecordType>()) {
OpenPOWER on IntegriCloud