forked from OSchip/llvm-project
Call MaybeBindToTemporary when constructing functino call operator calls.
llvm-svn: 79172
This commit is contained in:
parent
8c84c206d9
commit
1c83debc36
|
@ -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->
|
||||
|
|
|
@ -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()();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue