[cfe-commits] r79172 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/CodeGenCXX/temp-1.cpp

Anders Carlsson andersca at mac.com
Sat Aug 15 20:53:54 PDT 2009


Author: andersca
Date: Sat Aug 15 22:53:54 2009
New Revision: 79172

URL: http://llvm.org/viewvc/llvm-project?rev=79172&view=rev
Log:
Call MaybeBindToTemporary when constructing functino call operator calls.

Modified:
    cfe/trunk/lib/Sema/SemaOverload.cpp
    cfe/trunk/test/CodeGenCXX/temp-1.cpp

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=79172&r1=79171&r2=79172&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Sat Aug 15 22:53:54 2009
@@ -4555,7 +4555,7 @@
   if (CheckFunctionCall(Method, TheCall.get()))
     return true;
 
-  return TheCall.release();
+  return MaybeBindToTemporary(TheCall.release()).release();
 }
 
 /// BuildOverloadedArrowExpr - Build a call to an overloaded @c operator->

Modified: cfe/trunk/test/CodeGenCXX/temp-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/temp-1.cpp?rev=79172&r1=79171&r2=79172&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/temp-1.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/temp-1.cpp Sat Aug 15 22:53:54 2009
@@ -35,10 +35,23 @@
 };
 
 // RUN: grep "call void @_ZN1CC1Ev" %t | count 1 &&
-// RUN: grep "call void @_ZN1CD1Ev" %t | count 2
+// RUN: grep "call void @_ZN1CD1Ev" %t | count 2 &&
 void f3() {
   C().f();
 }
 
+// Function call operator
+struct D {
+  D();
+  ~D();
+  
+  D operator()();
+};
+
+// RUN: grep "call void @_ZN1DC1Ev" %t | count 1 &&
+// RUN: grep "call void @_ZN1DD1Ev" %t | count 2
+void f4() {
+  D()();
+}
 
 





More information about the cfe-commits mailing list