[cfe-commits] r105622 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/CodeGenCXX/copy-in-cplus-object.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Jun 8 10:52:11 PDT 2010
Author: fjahanian
Date: Tue Jun 8 12:52:11 2010
New Revision: 105622
URL: http://llvm.org/viewvc/llvm-project?rev=105622&view=rev
Log:
Fixes a typo which prevented proper code gen. for
copy-in of c++ class objects into blocks.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/CodeGenCXX/copy-in-cplus-object.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=105622&r1=105621&r2=105622&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Jun 8 12:52:11 2010
@@ -1764,8 +1764,7 @@
if (!Res.isInvalid()) {
Res = MaybeCreateCXXExprWithTemporaries(move(Res));
Expr *Init = Res.takeAs<Expr>();
- if (isa<CXXConstructExpr>(Init))
- BDRE->setCopyConstructorExpr(Init);
+ BDRE->setCopyConstructorExpr(Init);
}
}
return Owned(BDRE);
Modified: cfe/trunk/test/CodeGenCXX/copy-in-cplus-object.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-in-cplus-object.cpp?rev=105622&r1=105621&r2=105622&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-in-cplus-object.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-in-cplus-object.cpp Tue Jun 8 12:52:11 2010
@@ -1,8 +1,13 @@
// RUN: %clang_cc1 %s -fblocks -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
+struct S {
+ S(const char *);
+ ~S();
+};
+
struct TestObject
{
- TestObject(const TestObject& inObj, int def = 100);
+ TestObject(const TestObject& inObj, int def = 100, const S &Silly = "silly");
TestObject();
TestObject& operator=(const TestObject& inObj);
int version() const;
@@ -14,5 +19,8 @@
int (^V)() = ^{ return one.version(); };
}
-// CHECK: call void @_ZN10TestObjectC1ERKS_i
+// CHECK: call void @_ZN10TestObjectC1Ev
+// CHECK: call void @_ZN1SC1EPKc
+// CHECK: call void @_ZN10TestObjectC1ERKS_iRK1S
+// CHECK: call void @_ZN1SD1Ev
More information about the cfe-commits
mailing list