diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-04 19:13:37 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-04 19:13:37 +0000 |
commit | 105aa51c146b66f7dc4ac78faa9a7021acb98d75 (patch) | |
tree | 40294eeb92459396079a8933370cd40cf2d84483 /lib/CodeGen/CGCXX.cpp | |
parent | 862354188764f4a20be21d103bc2abd074ad048a (diff) |
Add code gen for pointer-to-member function in
ctor's initializer. Fixes pr5178.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index d8b532e697..d4adbad1e4 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -1421,6 +1421,8 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD, 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); |