[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 5 10:40:18 PST 2023
================
@@ -4952,7 +4952,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
std::make_pair(Function, PointOfInstantiation));
} else if (TSK == TSK_ImplicitInstantiation) {
if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() &&
- !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {
+ !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc()) &&
+ !Function->isVirtualAsWritten()) {
----------------
Fznamznon wrote:
Should we also check that it is pure? AFAIK `isVirtualAsWritten` returns true for function marked explicitly virtual. There is also `FunctionDecl::isPure()` to check that it is pure.
https://github.com/llvm/llvm-project/pull/74510
More information about the cfe-commits
mailing list