summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/dtor.cpp
diff options
context:
space:
mode:
authorisuckatcs <65320245+isuckatcs@users.noreply.github.com>2022-06-16 16:46:01 +0200
committerisuckatcs <65320245+isuckatcs@users.noreply.github.com>2022-07-14 23:30:21 +0200
commitb032e3ff6121a969b2e90ad7bf493c2d5d7ac3a2 (patch)
tree4577f3df303a52440831dd7226a3c22719167c3e /clang/test/Analysis/dtor.cpp
parent2da550140aa98cf6a3e96417c87f1e89e3a26047 (diff)
[analyzer] Evaluate construction of non-POD type arrays
Introducing the support for evaluating the constructor of every element in an array. The idea is to record the index of the current array member being constructed and create a loop during the analysis. We looping over the same CXXConstructExpr as many times as many elements the array has. Differential Revision: https://reviews.llvm.org/D127973
Diffstat (limited to 'clang/test/Analysis/dtor.cpp')
-rw-r--r--clang/test/Analysis/dtor.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/test/Analysis/dtor.cpp b/clang/test/Analysis/dtor.cpp
index 7935faca868a..bda7d19522bd 100644
--- a/clang/test/Analysis/dtor.cpp
+++ b/clang/test/Analysis/dtor.cpp
@@ -140,10 +140,8 @@ void testArrayInvalidation() {
IntWrapper arr[2];
// There should be no undefined value warnings here.
- // Eventually these should be TRUE as well, but right now
- // we can't handle array constructors.
- clang_analyzer_eval(arr[0].x == 0); // expected-warning{{UNKNOWN}}
- clang_analyzer_eval(arr[1].x == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(arr[0].x == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[1].x == 0); // expected-warning{{TRUE}}
arr[0].x = &i;
arr[1].x = &j;
@@ -312,10 +310,8 @@ namespace MultidimensionalArrays {
IntWrapper arr[2][2];
// There should be no undefined value warnings here.
- // Eventually these should be TRUE as well, but right now
- // we can't handle array constructors.
- clang_analyzer_eval(arr[0][0].x == 0); // expected-warning{{UNKNOWN}}
- clang_analyzer_eval(arr[1][1].x == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(arr[0][0].x == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[1][1].x == 0); // expected-warning{{TRUE}}
arr[0][0].x = &i;
arr[1][1].x = &j;
@@ -597,5 +593,5 @@ void overrideLeak() {
void overrideDoubleDelete() {
auto *a = new CustomOperators();
delete a;
- delete a; // expected-warning@581 {{Attempt to free released memory}}
+ delete a; // expected-warning@577 {{Attempt to free released memory}}
}