]> granicus.if.org Git - clang/commitdiff
List of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
authorDmitri Gribenko <gribozavr@gmail.com>
Sat, 6 Oct 2012 17:23:59 +0000 (17:23 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Sat, 6 Oct 2012 17:23:59 +0000 (17:23 +0000)
will do the right thing for new[] allocated memory.  Thanks David!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165365 91177308-0d34-0410-b5e6-96231b3b80d8

www/analyzer/potential_checkers.html

index a2d637548a0eccabd9728ded9cdec88afc974abc..025c0a8e1696f9191032de83e89592c62ac32fd5 100644 (file)
@@ -270,8 +270,10 @@ void f() throw(int) {
 (C++)</span><br><br>
 C++03: auto_ptr should store a pointer to an object obtained via new as allocated
 memory will be cleaned using delete<br>
-C++11: unique_ptr and shared_ptr allow
-to specify a custom deleter to handle the new[]/delete[] case correctly
+C++11: one should use unique_ptr&lt;T[]&gt; to keep a pointer to memory
+allocated by new[]<br>
+C++11: to keep a pointer to memory allocated by new[] in a shared_ptr one
+should use a custom deleter that calls delete[]
 </td><td><pre>
 #include &lt;stdlib.h&gt;
 #include &lt;memory&gt;