[clang] ce7eb72 - Thread safety analysis: Reword warning after D72635

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 13:27:03 PDT 2020


Author: Aaron Puchert
Date: 2020-04-27T22:23:52+02:00
New Revision: ce7eb72a3c87a9d15ba4962fa7a23aad24f98156

URL: https://github.com/llvm/llvm-project/commit/ce7eb72a3c87a9d15ba4962fa7a23aad24f98156
DIFF: https://github.com/llvm/llvm-project/commit/ce7eb72a3c87a9d15ba4962fa7a23aad24f98156.diff

LOG: Thread safety analysis: Reword warning after D72635

We allow arbitrary names for capabilities now, and the name didn't play
a role for this anyway.

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/test/SemaCXX/warn-thread-safety-parsing.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index c9aa49a31ed8..9c1b6c593857 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -3336,7 +3336,7 @@ def warn_thread_attribute_argument_not_lockable : Warning<
   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
 def warn_thread_attribute_decl_not_lockable : Warning<
   "%0 attribute can only be applied in a context annotated "
-  "with 'capability(\"mutex\")' attribute">,
+  "with 'capability' attribute">,
   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
 def warn_thread_attribute_decl_not_pointer : Warning<
   "%0 only applies to pointer types; type here is %1">,

diff  --git a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
index 198d02e1f076..6ad0f877a11d 100644
--- a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -496,7 +496,7 @@ Mutex aa_var_arg_bad_3 ACQUIRED_AFTER(muDoublePointer); // \
 Mutex aa_var_arg_bad_4 ACQUIRED_AFTER(umu); // \
   // expected-warning {{'acquired_after' attribute requires arguments whose type is annotated with 'capability' attribute}}
 UnlockableMu aa_var_arg_bad_5 ACQUIRED_AFTER(mu_aa); // \
-  // expected-warning {{'acquired_after' attribute can only be applied in a context annotated with 'capability("mutex")' attribute}}
+  // expected-warning {{'acquired_after' attribute can only be applied in a context annotated with 'capability' attribute}}
 
 //-----------------------------------------//
 //  Acquired Before (ab)
@@ -559,7 +559,7 @@ Mutex ab_var_arg_bad_3 ACQUIRED_BEFORE(muDoublePointer); // \
 Mutex ab_var_arg_bad_4 ACQUIRED_BEFORE(umu); // \
   // expected-warning {{'acquired_before' attribute requires arguments whose type is annotated with 'capability' attribute}}
 UnlockableMu ab_var_arg_bad_5 ACQUIRED_BEFORE(mu_ab); // \
-  // expected-warning {{'acquired_before' attribute can only be applied in a context annotated with 'capability("mutex")' attribute}}
+  // expected-warning {{'acquired_before' attribute can only be applied in a context annotated with 'capability' attribute}}
 
 
 //-----------------------------------------//


        


More information about the cfe-commits mailing list