ctor's initializer. Fixes pr5178.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86040
91177308-0d34-0410-b5e6-
96231b3b80d8
if (FieldType->isReferenceType())
RHS = EmitReferenceBindingToExpr(RhsExpr, FieldType,
/*IsInitializer=*/true);
+ else if (FieldType->isMemberFunctionPointerType())
+ RHS = RValue::get(CGM.EmitConstantExpr(RhsExpr, FieldType, this));
else
RHS = RValue::get(EmitScalarExpr(RhsExpr, true));
EmitStoreThroughLValue(RHS, LHS, FieldType);
struct A {
int Ai;
+bool foo(int* arg) const;
};
+bool A::foo(int* arg) const {
+ printf("A::foo(%d)\n", *arg);
+ return true;
+}
+
struct B : public A {
void bf() { printf("B::bf called\n"); }
};
g(x);
}
+struct B1 {
+ bool (A::*pmf)(int*) const;
+
+ B1(int i) : pmf(&A::foo), im(i) {
+ ((A*)this->*pmf)(&im);
+ }
+
+ int im;
+};
+
int main()
{
X x;
test2(x);
+ B1 b = B1(1);
+ B1 c = B1(2);
}
// CHECK-LP64: call __ZN1XcvM1BFvvEEv