Synthesize the default constructor which has not

been declared as needed.

llvm-svn: 77641
This commit is contained in:
Fariborz Jahanian
2009-07-30 23:22:00 +00:00
parent 16f58557d2
commit 6f14c73087
2 changed files with 19 additions and 1 deletions

View File

@@ -640,6 +640,14 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName,
// top-level declarations.
if (FD->isThisDeclarationADefinition() && MayDeferGeneration(FD))
DeferredDeclsToEmit.push_back(D);
// A called constructor which has no definition or declaration need be
// synthesized.
else if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(FD)) {
const CXXRecordDecl *ClassDecl =
cast<CXXRecordDecl>(CD->getDeclContext());
if (!ClassDecl->hasUserDeclaredConstructor())
DeferredDeclsToEmit.push_back(D);
}
}
// This function doesn't have a complete type (for example, the return