Before this commit, the -Wthread-safety check is only for C++ code.
This commit makes it available for C code as well.

Co-authored-by: Ethan Jackson <[email protected]>
Signed-off-by: Alex Wang <[email protected]>

Index: SemaDeclAttr.cpp
===================================================================
--- SemaDeclAttr.cpp    (revision 186655)
+++ SemaDeclAttr.cpp    (working copy)
@@ -586,7 +586,7 @@
     return false;
 
   // FIXME: Lockable structs for C code.
-  if (!isa<CXXRecordDecl>(D)) {
+  if (!isa<RecordDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::warn_thread_attribute_wrong_decl_type)
       << Attr.getName() << ThreadExpectedClassOrStruct;
     return false;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to