summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2013-12-13 11:30:23 +0000
committerSylvestre Ledru <sylvestre@debian.org>2013-12-13 11:30:23 +0000
commitaa7fc19d8683f1a58c675a4aa740092d2117507d (patch)
tree3edd0c13bea9634be8f9fea1d00efb3d7568d469
parentc27813a0ee224ef24671a36e8c6a6219cb20dbad (diff)
downloadclang-aa7fc19d8683f1a58c675a4aa740092d2117507d.tar.gz
clang-aa7fc19d8683f1a58c675a4aa740092d2117507d.tar.bz2
clang-aa7fc19d8683f1a58c675a4aa740092d2117507d.tar.xz
Improve the 3.4 release notes about the static analyzer new features
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197225 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/ReleaseNotes.rst43
1 files changed, 41 insertions, 2 deletions
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index c1554c64b7..d6b128f732 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -69,7 +69,7 @@ about them. The improvements since the 3.3 release include:
- Boolean increment, a deprecated feature, has own warning flag
-Wdeprecated-increment-bool, and is still part of -Wdeprecated.
- Clang errors on builtin enum increments and decrements.
-- -Wloop-analysis now warns on for-loops which have the same increment or
+- -Wloop-analysis now warns on for-loops which have the same increment or
decrement in the loop header as the last statement in the loop.
- -Wuninitialized now performs checking across field initializers to detect
when one field in used uninitialized in another field initialization.
@@ -189,9 +189,48 @@ Static Analyzer
---------------
The static analyzer (which contains additional code checking beyond compiler
-warnings) has improved significantly in both in the core analysis engine and
+warnings) has improved significantly in both in the core analysis engine and
also in the kinds of issues it can find.
+For example, the static analyzer now manages the following cases:
+
+- Missing return after function pointer null check.
+
+.. code-block:: c
+
+ void foo(void (*f)(void)) {
+ if (f)
+ return;
+ f();
+ }
+
+- Detect when ``delete`` is used on an uninitialized variable.
+
+.. code-block:: c++
+
+ void foo() {
+ int *x;
+ delete[] x;
+ }
+
+- Handle destructors for the argument to C++ ``delete``.
+
+.. code-block:: c++
+
+ class DerefClass{
+ public:
+ int *x;
+ DerefClass() {}
+ ~DerefClass() {*x = 1;}
+ };
+
+ void testDoubleDeleteClassInstance() {
+ DerefClass *foo = new DerefClass();
+ delete foo;
+ delete foo;
+ }
+
+
Clang Format
------------