================ @@ -11792,6 +11792,32 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD, OldDecl, Previous); } +static void CheckFunctionDeclarationAttributesUsage(Sema &S, + FunctionDecl *NewFD) { + const bool is_pure = NewFD->hasAttr<PureAttr>(); + const bool is_const = NewFD->hasAttr<ConstAttr>(); + + if (is_pure && is_const) { + S.Diag(NewFD->getLocation(), diag::warn_const_attr_with_pure_attr); + NewFD->dropAttr<PureAttr>(); + } + if (is_pure || is_const) { + if (isa<CXXConstructorDecl>(NewFD)) { ---------------- Endilll wrote:
I wonder if start of a lifetime and end of the lifetime that is tied to constructor and destructor can be considered side effects in this context, preventing them from ever being pure functions. https://github.com/llvm/llvm-project/pull/78200 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits