Modify some deleted function methods to better reflect reality:
- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)
This fixes the bug that we weren't catching
void foo() = delete;
void foo() {}
as being a redefinition.
llvm-svn: 131013
This commit is contained in:
@@ -727,7 +727,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
|
||||
}
|
||||
|
||||
// Forward declarations are emitted lazily on first use.
|
||||
if (!FD->isThisDeclarationADefinition())
|
||||
if (!FD->doesThisDeclarationHaveABody())
|
||||
return;
|
||||
} else {
|
||||
const VarDecl *VD = cast<VarDecl>(Global);
|
||||
@@ -897,7 +897,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
|
||||
assert(FD->isUsed() && "Sema didn't mark implicit function as used!");
|
||||
DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
|
||||
break;
|
||||
} else if (FD->isThisDeclarationADefinition()) {
|
||||
} else if (FD->doesThisDeclarationHaveABody()) {
|
||||
DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user