================ @@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind { VALID, }; -static bool CheckCountedByAttrOnField( - Sema &S, FieldDecl *FD, Expr *E, - llvm::SmallVectorImpl<TypeCoupledDeclRefInfo> &Decls) { +static bool +CheckCountedByAttrOnField(Sema &S, FieldDecl *FD, Expr *E, + llvm::SmallVectorImpl<TypeCoupledDeclRefInfo> &Decls, + bool CountInBytes, bool OrNull) { // Check the context the attribute is used in + unsigned Kind = CountInBytes; + if (OrNull) + Kind += 2; ---------------- delcypher wrote:
Rather than magic constants it might be better to use an enum that you refer to here and in `DiagnosticSemaKinds.td` so that it's more readable. https://github.com/llvm/llvm-project/pull/93231 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits