This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/lib/warnings/op: tests for RT #6870
[perl5.git] / t / lib / warnings / op
index cc0cf46..aba9c58 100644 (file)
@@ -2083,3 +2083,19 @@ my $x2 = !A || !B; # warning-free, because upper-case won't clash
 EXPECT
 Unquoted string "a" may clash with future reserved word at - line 2.
 Unquoted string "b" may clash with future reserved word at - line 2.
+########
+# RT #6870: Odd parsing of do...for...
+# This was really more a tokenizer bug, but it manifests as spurious warnings
+use warnings;
+no warnings 'reserved';
+$a=do xa for ax;
+do "xa" for ax;
+do xa for ax;
+do xa for "ax";
+do xa for sin(1);
+do xa for (sin(1));
+do xa for "sin";
+do xa for qq(sin);
+do xa for my $a;
+do xa for my @a;
+EXPECT