summaryrefslogtreecommitdiff
path: root/docs/analyzer
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@quicinc.com>2019-05-24 19:24:08 +0000
committerMandeep Singh Grang <mgrang@quicinc.com>2019-05-24 19:24:08 +0000
commit6d0f28c0841eecb958449aad72ab87bbf406b95e (patch)
tree988c7bbf905cb67f8403b801e5af3a75a6cb5c75 /docs/analyzer
parentafa4c645e14ff0a0c68d3072d45a3df2ca0b46ed (diff)
downloadclang-6d0f28c0841eecb958449aad72ab87bbf406b95e.tar.gz
[Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers
Summary: Added a checker for non-determinism caused by iterating unordered containers like std::unordered_set containing pointer elements. Reviewers: NoQ, george.karpenkov, whisperity, Szelethus, baloghadamsoftware Reviewed By: Szelethus Subscribers: mgorny, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, jdoerfert, Charusso, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59279 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/analyzer')
-rw-r--r--docs/analyzer/checkers.rst18
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/analyzer/checkers.rst b/docs/analyzer/checkers.rst
index b13d4d04d4..6a266eb1d9 100644
--- a/docs/analyzer/checkers.rst
+++ b/docs/analyzer/checkers.rst
@@ -211,8 +211,8 @@ Check for uninitialized values being returned to the caller.
.. _cplusplus-checkers:
-cpluslus
-^^^^^^^^
+cplusplus
+^^^^^^^^^
C++ Checkers.
@@ -1951,6 +1951,20 @@ Check for out-of-bounds access in string functions; applies to:`` strncopy, strn
int y = strlen((char *)&test); // warn
}
+alpha.nondeterminism.PointerIteration (C++)
+"""""""""""""""""""""""""""""""""""""""""""
+Check for non-determinism caused by iterating unordered containers of pointers.
+
+.. code-block:: c
+
+ void test() {
+ int a = 1, b = 2;
+ std::unordered_set<int *> UnorderedPtrSet = {&a, &b};
+
+ for (auto i : UnorderedPtrSet) // warn
+ f(i);
+ }
+
alpha.nondeterminism.PointerSorting (C++)
"""""""""""""""""""""""""""""""""""""""""
Check for non-determinism caused by sorting of pointers.