summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/array-init-loop.cpp
AgeCommit message (Collapse)Author
2025-02-26[analyzer] Update the undefined assignment checker diagnostics to not use ↵David Tarditi
the term 'garbage' (#126596) A clang user pointed out that messages for the static analyzer undefined assignment checker use the term ‘garbage’, which might have a negative connotation to some users. This change updates the messages to use the term ‘uninitialized’. This is the usual reason why a value is undefined in the static analyzer and describes the logical error that a programmer should take action to fix. Out-of-bounds reads can also produce undefined values in the static analyzer. The right long-term design is to have to the array bounds checker cover out-of-bounds reads, so we do not cover that case in the updated messages. The recent improvements to the array bounds checker make it a candidate to add to the core set of checkers. rdar://133418644
2024-10-26[analyzer] Fix a crash from element region construction during ↵isuckatcs
`ArrayInitLoopExpr` analysis (#113570) This patch generalizes the way element regions are constructed when an `ArrayInitLoopExpr` is being analyzed. Previously the base region of the `ElementRegion` was determined with pattern matching, which led to crashes, when an unhandled pattern was encountered. Fixes #112813
2022-08-25[analyzer] Fix for incorrect handling of 0 length non-POD array constructionisuckatcs
Prior to this patch when the analyzer encountered a non-POD 0 length array, it still invoked the constructor for 1 element, which lead to false positives. This patch makes sure that we no longer construct any elements when we see a 0 length array. Differential Revision: https://reviews.llvm.org/D131501
2022-08-22[analyzer] Handling non-POD multidimensional arrays in ArrayInitLoopExprisuckatcs
This patch makes it possible for lambdas, implicit copy/move ctors and structured bindings to handle non-POD multidimensional arrays. Differential Revision: https://reviews.llvm.org/D131840
2022-07-26[analyzer] Lambda capture non-POD type arrayisuckatcs
This patch introduces a new `ConstructionContext` for lambda capture. This `ConstructionContext` allows the analyzer to construct the captured object directly into it's final region, and makes it possible to capture non-POD arrays. Differential Revision: https://reviews.llvm.org/D129967
2022-07-26[analyzer] ArrayInitLoopExpr with array of non-POD typeisuckatcs
This patch introduces the evaluation of ArrayInitLoopExpr in case of structured bindings and implicit copy/move constructor. The idea is to call the copy constructor for every element in the array. The parameter of the copy constructor is also manually selected, as it is not a part of the CFG. Differential Revision: https://reviews.llvm.org/D129496
2022-06-23[analyzer] Structured binding to arraysisuckatcs
Introducing structured binding to data members and more. To handle binding to arrays, ArrayInitLoopExpr is also evaluated, which enables the analyzer to store information in two more cases. These are: - when a lambda-expression captures an array by value - in the implicit copy/move constructor for a class with an array member Differential Revision: https://reviews.llvm.org/D126613