[all-commits] [llvm/llvm-project] 017675: [attributes][analyzer] Generalize [[clang::suppres...
Artem Dergachev via All-commits
all-commits at lists.llvm.org
Tue Feb 13 14:58:06 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 017675fff116c26bef7f0a389c983c909a3141fd
https://github.com/llvm/llvm-project/commit/017675fff116c26bef7f0a389c983c909a3141fd
Author: Artem Dergachev <adergachev at apple.com>
Date: 2024-02-13 (Tue, 13 Feb 2024)
Changed paths:
M clang/include/clang/Basic/Attr.td
M clang/include/clang/Basic/AttrDocs.td
M clang/lib/Sema/SemaDecl.cpp
M clang/lib/Sema/SemaDeclAttr.cpp
M clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp
M clang/lib/StaticAnalyzer/Core/BugSuppression.cpp
M clang/test/Analysis/Checkers/WebKit/ref-cntbl-base-virtual-dtor.cpp
M clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures.cpp
M clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
M clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
M clang/test/Analysis/ObjCRetSigs.m
M clang/test/Analysis/objc_invalidation.m
M clang/test/Analysis/suppression-attr-doc.cpp
A clang/test/Analysis/suppression-attr.cpp
M clang/test/Analysis/suppression-attr.m
M clang/test/Analysis/unused-ivars.m
M clang/test/SemaCXX/attr-suppress.cpp
M clang/test/SemaObjC/attr-suppress.m
Log Message:
-----------
[attributes][analyzer] Generalize [[clang::suppress]] to declarations. (#80371)
The attribute is now allowed on an assortment of declarations, to
suppress warnings related to declarations themselves, or all warnings in
the lexical scope of the declaration.
I don't necessarily see a reason to have a list at all, but it does look
as if some of those more niche items aren't properly supported by the
compiler itself so let's maintain a short safe list for now.
The initial implementation raised a question whether the attribute
should apply to lexical declaration context vs. "actual" declaration
context. I'm using "lexical" here because it results in less warnings
suppressed, which is the conservative behavior: we can always expand it
later if we think this is wrong, without breaking any existing code. I
also think that this is the correct behavior that we will probably never
want to change, given that the user typically desires to keep the
suppressions as localized as possible.
More information about the All-commits
mailing list