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
authorDan Collins <dcollinsn@gmail.com>
Mon, 4 Jul 2016 23:33:29 +0000 (19:33 -0400)
committerYves Orton <demerphq@gmail.com>
Fri, 21 Oct 2016 07:09:44 +0000 (09:09 +0200)
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