[cfe-commits] r79168 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/CodeGenCXX/temp-1.cpp
Anders Carlsson
andersca at mac.com
Sat Aug 15 20:06:32 PDT 2009
Author: andersca
Date: Sat Aug 15 22:06:32 2009
New Revision: 79168
URL: http://llvm.org/viewvc/llvm-project?rev=79168&view=rev
Log:
Make sure to call MaybeBindToTemporary when creating CallExprs.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/CodeGenCXX/temp-1.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=79168&r1=79167&r2=79168&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sat Aug 15 22:06:32 2009
@@ -2942,7 +2942,7 @@
return ExprError();
}
- return Owned(TheCall.take());
+ return MaybeBindToTemporary(TheCall.take());
}
Action::OwningExprResult
Modified: cfe/trunk/test/CodeGenCXX/temp-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/temp-1.cpp?rev=79168&r1=79167&r2=79168&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/temp-1.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/temp-1.cpp Sat Aug 15 22:06:32 2009
@@ -5,9 +5,24 @@
void f();
};
-void f() {
- // RUN: grep "call void @_ZN1AC1Ev" %t | count 2 &&
- // RUN: grep "call void @_ZN1AD1Ev" %t | count 2
- A();
+// RUN: grep "call void @_ZN1AC1Ev" %t | count 2 &&
+// RUN: grep "call void @_ZN1AD1Ev" %t | count 2 &&
+void f1() {
+ (void)A();
A().f();
}
+
+// Calls
+struct B {
+ B();
+ ~B();
+};
+
+B g();
+
+// RUN: grep "call void @_ZN1BC1Ev" %t | count 0 &&
+// RUN: grep "call void @_ZN1BD1Ev" %t | count 1
+void f2() {
+ (void)g();
+}
+
More information about the cfe-commits
mailing list