From 001309371e199f0c5f3931b80f67309dcd157848 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 6 Aug 2009 19:12:38 +0000 Subject: Set and use Elidable in elimination of copy ctors. llvm-svn: 78331 --- clang/lib/Sema/SemaInit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaInit.cpp') diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 445cd691d6a..29113822f73 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -176,9 +176,10 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType, DirectInit? IK_Direct : IK_Copy); if (!Constructor) return true; - + bool Elidable = (isa(Init) || + isa(Init)); Init = BuildCXXConstructExpr(Context, - DeclType, Constructor, false, &Init, 1); + DeclType, Constructor, Elidable, &Init, 1); Init = MaybeCreateCXXExprWithTemporaries(Init, /*DestroyTemps=*/true); return false; } -- cgit v1.2.3