================ @@ -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()) { ---------------- charmitro wrote:
After double-checking this, I think we should just check for `isPure()` and don't bother checking for `isVirtualAsWritten()` at all since non-virtual functions cannot be pure. Also, for reference, https://github.com/llvm/llvm-project/blob/d6fbd96e5eaf3e8acbf1b43dce7a311352907567/clang/include/clang/AST/Decl.h#L2293-L2295 Code updated to match this. Also a test-case added to verify that non-pure virtual functions still get diagnosed. https://github.com/llvm/llvm-project/pull/74510 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits