[clang-tools-extra] r248594 - [clang-tidy] Updated misc-unused-raii documentation.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 10:50:12 PDT 2015


Author: alexfh
Date: Fri Sep 25 12:50:11 2015
New Revision: 248594

URL: http://llvm.org/viewvc/llvm-project?rev=248594&view=rev
Log:
[clang-tidy] Updated misc-unused-raii documentation.

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h
    clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unused-raii.rst

Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h?rev=248594&r1=248593&r2=248594&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h Fri Sep 25 12:50:11 2015
@@ -18,28 +18,8 @@ namespace misc {
 
 /// Finds temporaries that look like RAII objects.
 ///
-/// The canonical example for this is a scoped lock.
-///
-/// \code
-///   {
-///     scoped_lock(&global_mutex);
-///     critical_section();
-///   }
-/// \endcode
-///
-/// The destructor of the scoped_lock is called before the `critical_section` is
-/// entered, leaving it unprotected.
-///
-/// We apply a number of heuristics to reduce the false positive count of this
-/// check:
-///
-///   * Ignore code expanded from macros. Testing frameworks make heavy use of
-///     this.
-///   * Ignore types with no user-declared constructor. Those are very unlikely
-///     to be RAII objects.
-///   * Ignore objects at the end of a compound statement (doesn't change
-///     behavior).
-///   * Ignore objects returned from a call.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-unused-raii.html
 class UnusedRAIICheck : public ClangTidyCheck {
 public:
   UnusedRAIICheck(StringRef Name, ClangTidyContext *Context)

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unused-raii.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unused-raii.rst?rev=248594&r1=248593&r2=248594&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unused-raii.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unused-raii.rst Fri Sep 25 12:50:11 2015
@@ -19,10 +19,8 @@ entered, leaving it unprotected.
 We apply a number of heuristics to reduce the false positive count of this
 check:
 
-  * Ignore code expanded from macros. Testing frameworks make heavy use of
-    this.
-  * Ignore types with no user-declared constructor. Those are very unlikely
-    to be RAII objects.
-  * Ignore objects at the end of a compound statement (doesn't change
-    behavior).
+  * Ignore code expanded from macros. Testing frameworks make heavy use of this.
+  * Ignore types with trivial destructors. They are very unlikely to be RAII
+    objects and there's no difference when they are deleted.
+  * Ignore objects at the end of a compound statement (doesn't change behavior).
   * Ignore objects returned from a call.




More information about the cfe-commits mailing list