aaronpuchert marked an inline comment as done.
aaronpuchert added a comment.
In https://reviews.llvm.org/D51901#1239759, @delesley wrote:
> This looks okay to me, but I have not tested it on a large code base to see
> if it breaks anything.
On our code base (not as large as Google's) there was
This revision was automatically updated to reflect the committed changes.
Closed by commit rC342605: Thread Safety Analysis: warnings for attributes
without arguments (authored by aaronpuchert, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D51901?vs=165004&id=166205#toc
Rep
delesley accepted this revision.
delesley added a comment.
This revision is now accepted and ready to land.
This looks okay to me, but I have not tested it on a large code base to see if
it breaks anything.
Comment at: lib/Sema/SemaDeclAttr.cpp:589
+<< AL << MD->ge
aaronpuchert marked an inline comment as done.
aaronpuchert added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:3016-3017
+def warn_thread_attribute_not_on_capability_member : Warning<
+ "%0 attribute without capability arguments can only be applied in
aaronpuchert updated this revision to Diff 165004.
aaronpuchert added a comment.
Improved handling of type-dependent base classes and slightly reworded warning
message.
Repository:
rC Clang
https://reviews.llvm.org/D51901
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDe
jmgao added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:3016-3017
+def warn_thread_attribute_not_on_capability_member : Warning<
+ "%0 attribute without capability arguments can only be applied in a class "
+ "annotated with 'capability' or 'scoped_l
aaronpuchert added a comment.
The second warning message is a bit long, so if any of you have a better idea
I'd welcome it.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:3016-3017
+def warn_thread_attribute_not_on_capability_member : Warning<
+ "%0 attribute without
aaronpuchert created this revision.
aaronpuchert added reviewers: aaron.ballman, delesley, jmgao.
Herald added a subscriber: cfe-commits.
When thread safety annotations are used without capability arguments,
they are assumed to apply to `this` instead. So we warn when either
`this` doesn't exist,