summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-03-04 21:39:47 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-03-04 21:39:47 +0000
commit7921d0f22732c0609e6c9d21be9aaf6e52f99e6b (patch)
tree8a6f3a8a8dcce2d297997970c51bb71e892872a3 /t
parentf687c58382f4b95feb695ed73228b771780e828e (diff)
downloadperl-7921d0f22732c0609e6c9d21be9aaf6e52f99e6b.tar.gz
add deprecation warning for my $x if 0
p4raw-id: //depot/perl@22435
Diffstat (limited to 't')
-rw-r--r--t/lib/warnings/op25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index 95f3fc8b56..c39a7b2fd9 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -1053,3 +1053,28 @@ Useless localization of defined or assignment (//=) at - line 45.
Useless localization of substr at - line 48.
Useless localization of match position at - line 49.
Useless localization of vec at - line 50.
+########
+# op.c
+use warnings 'deprecated';
+my $x1 if 0;
+my @x2 if 0;
+my %x3 if 0;
+my ($x4) if 0;
+my ($x5,@x6, %x7) if 0;
+0 && my $z1;
+0 && my (%z2);
+# these shouldn't warn
+our $x if 0;
+our $x unless 0;
+if (0) { my $w1 }
+if (my $w2) { $a=1 }
+if ($a && (my $w3 = 1)) {$a = 2}
+
+EXPECT
+Deprecated use of my() in false conditional at - line 3.
+Deprecated use of my() in false conditional at - line 4.
+Deprecated use of my() in false conditional at - line 5.
+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.