Warnings within the condition of while are not reported with the
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / 9uninit
index fea20f0..b1c2a4f 100644 (file)
@@ -1322,7 +1322,6 @@ exit $m1;
 EXPECT
 Use of uninitialized value $m1 in exit at - line 4.
 ########
-# TODO long standing bug - PL_curcop is not updated before the elsif
 use warnings 'uninitialized';
 my $undef;
 
@@ -1333,6 +1332,22 @@ EXPECT
 Use of uninitialized value $undef in numeric eq (==) at - line 4.
 Use of uninitialized value $undef in numeric eq (==) at - line 5.
 ########
+# TODO long standing bug - conditions of while loops
+use warnings;
+
+my $c;
+my $d = 1;
+while ($c == 0 && $d) {
+  # a
+  # few
+  # blank
+  # lines
+  undef $d;
+}
+EXPECT
+Use of uninitialized value $c in numeric eq (==) at - line 5.
+Use of uninitialized value $c in numeric eq (==) at - line 5.
+########
 # TODO long standing bug - more general variant of the above problem
 use warnings;
 my $undef;