[cfe-commits] r165365 - /cfe/trunk/www/analyzer/potential_checkers.html

Dmitri Gribenko gribozavr at gmail.com
Sat Oct 6 10:24:00 PDT 2012


Author: gribozavr
Date: Sat Oct  6 12:23:59 2012
New Revision: 165365

URL: http://llvm.org/viewvc/llvm-project?rev=165365&view=rev
Log:
List of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
will do the right thing for new[] allocated memory.  Thanks David!

Modified:
    cfe/trunk/www/analyzer/potential_checkers.html

Modified: cfe/trunk/www/analyzer/potential_checkers.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/potential_checkers.html?rev=165365&r1=165364&r2=165365&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/potential_checkers.html (original)
+++ cfe/trunk/www/analyzer/potential_checkers.html Sat Oct  6 12:23:59 2012
@@ -270,8 +270,10 @@
 (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<T[]> 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 <stdlib.h>
 #include <memory>





More information about the cfe-commits mailing list