[PATCH] D82598: [analyzer][Liveness][NFC] Get rid of statement liveness, because such a thing doesn't exist
Kristóf Umann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 20 07:44:19 PDT 2020
Szelethus added a comment.
I chased my own tail for weeks before realizing that there is indeed another instance when a live **statement** is stored, other then `ObjCForCollectionStmt`...
void clang_analyzer_eval(bool);
void test_lambda_refcapture() {
int a = 6;
[&](int &a) { a = 42; }(a);
clang_analyzer_eval(a == 42); // expected-warning{{TRUE}}
}
// CHECK: [ B0 (live statements at block exit) ]
// CHECK-EMPTY:
// CHECK-EMPTY:
// CHECK-NEXT: [ B1 (live statements at block exit) ]
// CHECK-EMPTY:
// CHECK-EMPTY:
// CHECK-NEXT: [ B2 (live statements at block exit) ]
// CHECK-EMPTY:
// CHECK-NEXT: CompoundStmt {{.*}}
// CHECK-NEXT: `-BinaryOperator {{.*}} 'int' lvalue '='
// CHECK-NEXT: |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'a' 'int &'
// CHECK-NEXT: `-IntegerLiteral {{.*}} 'int' 42
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82598/new/
https://reviews.llvm.org/D82598
More information about the cfe-commits
mailing list