File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -318,8 +318,11 @@ void test1() {
318318
319319void test2 () {
320320 int a = 0 ;
321+ int *c = &a;
322+
321323 auto incr_a = [a]() { };
322324 auto incr_b = [](int b) { };
325+ auto incr_c = [c]() { ++*c; };
323326
324327 for (int b = 10 ; a <= b; incr_a ()) // expected-warning {{variables 'a' and 'b' used in loop condition not modified in loop body}}
325328 foo (a);
@@ -332,5 +335,9 @@ void test2() {
332335
333336 for (int b = 10 ; a <= b;) // expected-warning {{variables 'a' and 'b' used in loop condition not modified in loop body}}
334337 incr_b (b);
338+
339+ // FIXME: handle modification of loop control variable inside lambda body
340+ for (a = 10 ; a <= 20 ; incr_c ()) // expected-warning {{variable 'a' used in loop condition not modified in loop body}}
341+ foo (a);
335342}
336343}
You can’t perform that action at this time.
0 commit comments