[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)

Charalampos Mitrodimas via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 08:57:41 PST 2024


================
@@ -18931,7 +18931,7 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
   //   constant evaluated
   bool NeededForConstantEvaluation =
       isPotentiallyConstantEvaluatedContext(*this) &&
-      isImplicitlyDefinableConstexprFunction(Func);
+      isImplicitlyDefinableConstexprFunction(Func) && !Func->isPure();
----------------
charmitro wrote:

Moving it to `NeedDefinition` silences the warnings of test `call_pure_virtual_function_from_virtual`, where we still require warnings for it, as mentioned in https://github.com/llvm/llvm-project/issues/74016#issuecomment-1845636487.

https://github.com/llvm/llvm-project/pull/74510


More information about the cfe-commits mailing list