aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index bb53dcc39e..708100e2a0 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -238,7 +238,17 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD,
EmitDtorEpilogue(DD);
FinishFunction(S->getRBracLoc());
}
-
+ else
+ if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(FD)) {
+ assert(
+ !cast<CXXRecordDecl>(CD->getDeclContext())->
+ hasUserDeclaredConstructor() &&
+ "bogus constructor is being synthesize");
+ StartFunction(FD, FD->getResultType(), Fn, Args, SourceLocation());
+ EmitCtorPrologue(CD);
+ FinishFunction();
+ }
+
// Destroy the 'this' declaration.
if (CXXThisDecl)
CXXThisDecl->Destroy(getContext());