Actually submit previous change.
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / op
index ca92412..8dadc7a 100644 (file)
@@ -528,6 +528,7 @@ use warnings 'void' ;
 5 || print "bad\n";    # test OPpCONST_SHORTCIRCUIT
 use constant U => undef;
 print "boo\n" if U;    # test OPpCONST_SHORTCIRCUIT
+$[ = 2; # should not warn
 no warnings 'void' ;
 "abc"; # OP_CONST
 7 ; # OP_CONST
@@ -1023,6 +1024,7 @@ local(pos($x));           # OP_POS
 local(vec($x,0,1));    # OP_VEC
 local($a[$b]);         # OP_AELEM              ok
 local($a{$b});         # OP_HELEM              ok
+local($[);             # OP_CONST
 
 no warnings 'syntax';
 EXPECT
@@ -1079,3 +1081,23 @@ Deprecated use of my() in false conditional at - line 6.
 Deprecated use of my() in false conditional at - line 7.
 Deprecated use of my() in false conditional at - line 8.
 Deprecated use of my() in false conditional at - line 9.
+########
+# op.c
+use feature 'state';
+use warnings 'misc';
+state($x) = 1;
+(state $y) = 2;
+(state $z, my $t) = (3, 4);
+(state $foo, state $bar) = (5, 6);
+(undef, my $v, state $w) = (7 .. 9);
+no warnings 'misc';
+state($x) = 1;
+(state $y) = 2;
+(state $z, my $t) = (3, 4);
+(state $foo, state $bar) = (5, 6);
+(undef, my $v, state $w) = (7 .. 9);
+EXPECT
+State variable $z will be reinitialized at - line 6.
+State variable $foo will be reinitialized at - line 7.
+State variable $bar will be reinitialized at - line 7.
+State variable $w will be reinitialized at - line 8.