================ @@ -614,9 +619,23 @@ static bool checkTryLockFunAttrCommon(Sema &S, Decl *D, const ParsedAttr &AL, return false; } - // check that all arguments are lockable objects + // Check that all remaining arguments are lockable objects. checkAttrArgsAreCapabilityObjs(S, D, AL, Args, 1); + // Check that the attribute is applied to a function. + if (!D->isFunctionOrFunctionTemplate()) { ---------------- AaronBallman wrote:
Is this check needed? The definition in Attr.td already specifies a subject list including functions, so I believe this is already handled automatically. https://github.com/llvm/llvm-project/pull/95290 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits