case CXXTypeidExprClass:
// C++ 5.2.8p1: The result of a typeid expression is an lvalue of ...
return LV_Valid;
+ case CXXBindTemporaryExprClass:
+ return cast<CXXBindTemporaryExpr>(this)->getSubExpr()->
+ isLvalueInternal(Ctx);
case ConditionalOperatorClass: {
// Complicated handling is only for C++.
if (!Ctx.getLangOptions().CPlusPlus)
if (CheckFunctionCall(Method, TheCall.get()))
return true;
-
- return TheCall.release();
+
+ return MaybeBindToTemporary(TheCall.release()).release();
}
/// BuildCallToObjectOfClassType - Build a call to an object of class
A().f();
}
-// Calls
+// Function calls
struct B {
B();
~B();
B g();
// RUN: grep "call void @_ZN1BC1Ev" %t | count 0 &&
-// RUN: grep "call void @_ZN1BD1Ev" %t | count 1
+// RUN: grep "call void @_ZN1BD1Ev" %t | count 1 &&
void f2() {
(void)g();
}
+// Member function calls
+struct C {
+ C();
+ ~C();
+
+ C f();
+};
+
+// RUN: grep "call void @_ZN1CC1Ev" %t | count 1 &&
+// RUN: grep "call void @_ZN1CD1Ev" %t | count 2
+void f3() {
+ C().f();
+}
+
+
+