Call MaybeBindToTemporary when constructing functino call operator calls.

llvm-svn: 79172
This commit is contained in:
Anders Carlsson 2009-08-16 03:53:54 +00:00
parent 8c84c206d9
commit 1c83debc36
2 changed files with 15 additions and 2 deletions

View File

@ -4555,7 +4555,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object,
if (CheckFunctionCall(Method, TheCall.get()))
return true;
return TheCall.release();
return MaybeBindToTemporary(TheCall.release()).release();
}
/// BuildOverloadedArrowExpr - Build a call to an overloaded @c operator->

View File

@ -35,10 +35,23 @@ struct C {
};
// 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()();
}