Synthesize the default constructor which has not
been declared as needed.
llvm-svn: 77641
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index bb53dcc..708100e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -238,7 +238,17 @@
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());