Open
Bug 1307170
Opened 8 years ago
Updated 2 years ago
Reject clang static analysis attributes in invalid locations
Categories
(Developer Infrastructure :: Source Code Analysis, defect, P3)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
NEW
People
(Reporter: nika, Unassigned)
References
Details
(Whiteboard: leave-open)
Attachments
(1 obsolete file)
We have a bunch of annotations which we have added for the clang static analysis, and it would be good to make sure that people are using them correctly, and not placing them in places where they would not be recognized by the analysis. We should error out if they are placed in the wrong places.
Updated•8 years ago
|
Whiteboard: leave-open
Comment 1•8 years ago
|
||
This is to restrict the usage of MOZ_REQUIRED_BASE_METHOD only for CXXMethodDecl that is also virtual. I'm not sure that we should also enforce it that the parent CXXRecordDecl should be base.
Attachment #8797632 -
Flags: feedback?(michael)
Reporter | ||
Comment 2•8 years ago
|
||
Comment on attachment 8797632 [details] [diff] [review] 316155.patch Review of attachment 8797632 [details] [diff] [review]: ----------------------------------------------------------------- ::: build/clang-plugin/clang-plugin.cpp @@ +163,4 @@ > virtual void run(const MatchFinder::MatchResult &Result); > }; > > + class OverrideBaseCallAnnotationChecker I feel like we should at least add some comment somewhere here which explains that this is a companion checker, and is just used to ensure that we don't include the annotation in places it would be ignored. @@ +186,4 @@ > RefCountedCopyConstructorChecker RefCountedCopyConstructor; > AssertAssignmentChecker AssertAttribution; > KungFuDeathGripChecker KungFuDeathGrip; > + OverrideBaseCallAnnotationChecker OverrideBaseCallAnnotation; I'm not sure that I like this name. Perhaps OverrideBaseCallUsageChecker to signify that we are validating the usage of this attribute? @@ +875,5 @@ > AST_MATCHER(QualType, isRefPtr) { > return typeIsRefPtr(Node); > } > + > +AST_MATCHER(CXXMethodDecl, hasBaseCallAnnotationForNonVirtual) { This checker feels like it's doing too much, can we have a isNotVirtual and the isRequiredBaseMethod checker separately?
Attachment #8797632 -
Flags: feedback?(michael) → feedback+
Reporter | ||
Comment 3•8 years ago
|
||
Another note, I feel like this bug should be a metabug, can we move this patch onto another bug which blocks this one?
Updated•8 years ago
|
Attachment #8797632 -
Attachment is obsolete: true
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•