1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config widen-loops=true -analyzer-disable-retry-exhausted -verify %s
3 void clang_analyzer_eval(bool);
4 void clang_analyzer_dump(int);
6 // 'this' pointer is not an lvalue, we should not invalidate it.
7 namespace this_pointer_after_loop_widen
{
18 void test_temporary_object() {
25 for (int i
= 0; i
< 10; ++i
) {
33 clang_analyzer_eval(b
.mem
== 0); // expected-warning{{TRUE}}
40 for (int i
= 0; i
< 10; ++i
) {
48 clang_analyzer_eval(c
.mem
== 0); // expected-warning{{TRUE}}
50 clang_analyzer_eval(c
.mem
== 10); // expected-warning{{TRUE}}
57 for (int i
= 0; i
< 10; ++i
) {
65 clang_analyzer_eval(d
->mem
== 0); // expected-warning{{TRUE}}
67 clang_analyzer_eval(d
->mem
== 10); // expected-warning{{TRUE}}
74 for (int i
= 0; i
< 10; ++i
) {
83 void test_chained_method_call() {
86 clang_analyzer_eval(e
.mem
== 10); // expected-warning{{TRUE}}
88 } // namespace this_pointer_after_loop_widen