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

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 14:04:42 PDT 2024


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

I am not sure why moving it down silences the diagnostic, I would think doing `(OdrUse == OdrUseContext::Used || NeededForConstantEvaluation || !Func->isPure())` should work. 

Can you explain in more detail?

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


More information about the cfe-commits mailing list