[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 5 12:14:23 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() && !Function->isPure()) {
----------------
cor3ntin wrote:
```suggestion
!(Function->isVirtualAsWritten() && Function->isPure()) {
```
Can you add a test to make sure non-pure virtual function still get diagnosed?
https://github.com/llvm/llvm-project/pull/74510
More information about the cfe-commits
mailing list