summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/t/lib
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
committerafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
commit91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch)
tree3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/t/lib
parentdo not call purge_task every 10 secs, it is only needed once at startup and (diff)
downloadwireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz
wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/t/lib')
-rw-r--r--gnu/usr.bin/perl/t/lib/1_compile.t35
-rw-r--r--gnu/usr.bin/perl/t/lib/Count.pm8
-rw-r--r--gnu/usr.bin/perl/t/lib/Devel/nodb.pm3
-rw-r--r--gnu/usr.bin/perl/t/lib/charnames/alias144
-rw-r--r--gnu/usr.bin/perl/t/lib/common.pl2
-rw-r--r--gnu/usr.bin/perl/t/lib/commonsense.t25
-rw-r--r--gnu/usr.bin/perl/t/lib/croak/op13
-rw-r--r--gnu/usr.bin/perl/t/lib/croak/pp_ctl8
-rw-r--r--gnu/usr.bin/perl/t/lib/croak/pp_hot60
-rw-r--r--gnu/usr.bin/perl/t/lib/croak/toke130
-rw-r--r--gnu/usr.bin/perl/t/lib/feature/switch30
-rw-r--r--gnu/usr.bin/perl/t/lib/strict/refs25
-rw-r--r--gnu/usr.bin/perl/t/lib/strict/subs15
-rw-r--r--gnu/usr.bin/perl/t/lib/strict/vars8
-rw-r--r--gnu/usr.bin/perl/t/lib/test_require.pm6
-rw-r--r--gnu/usr.bin/perl/t/lib/universal.t2
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/2use19
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/9uninit78
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/doio6
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/gv50
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/op207
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/pad24
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/perl6
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/perly236
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/pp6
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/pp_hot27
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/regcomp265
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/toke101
-rw-r--r--gnu/usr.bin/perl/t/lib/warnings/utf8465
29 files changed, 1350 insertions, 654 deletions
diff --git a/gnu/usr.bin/perl/t/lib/1_compile.t b/gnu/usr.bin/perl/t/lib/1_compile.t
index a4dea830544..2802ae2ad64 100644
--- a/gnu/usr.bin/perl/t/lib/1_compile.t
+++ b/gnu/usr.bin/perl/t/lib/1_compile.t
@@ -7,9 +7,9 @@
BEGIN {
chdir 't';
@INC = '../lib';
+ require './test.pl';
}
-use strict;
use warnings;
use File::Spec::Functions;
@@ -27,28 +27,22 @@ if (eval { require Socket }) {
@Core_Modules = sort @Core_Modules;
-print "1..".(1+@Core_Modules)."\n";
+plan tests => 1+@Core_Modules;
-my $message
- = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n";
-if (@Core_Modules) {
- print "not $message";
-} else {
- print $message;
-}
-print <<'EOREWARD';
-# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01223.html
-# 20010421230349.P2946@blackrider.blackstar.co.uk
-EOREWARD
-
-my $test_num = 2;
+cmp_ok(@Core_Modules, '>', 0, "All modules should have tests");
+note("http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01223.html");
+note("20010421230349.P2946\@blackrider.blackstar.co.uk");
foreach my $module (@Core_Modules) {
- my $todo = '';
- $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS';
- print "# $module compile failed\nnot " unless compile_module($module);
- print "ok $test_num $todo\n";
- $test_num++;
+ if ($module eq 'ByteLoader' && $^O eq 'VMS') {
+ TODO: {
+ local $TODO = "$module needs porting on $^O";
+ ok(compile_module($module), "compile $module");
+ }
+ }
+ else {
+ ok(compile_module($module), "compile $module");
+ }
}
# We do this as a separate process else we'll blow the hell
@@ -60,7 +54,6 @@ sub compile_module {
my $lib = '-I' . catdir(updir(), 'lib');
my $out = scalar `$^X $lib $compmod $module`;
- print "# $out";
return $out =~ /^ok/;
}
diff --git a/gnu/usr.bin/perl/t/lib/Count.pm b/gnu/usr.bin/perl/t/lib/Count.pm
new file mode 100644
index 00000000000..635b5de6910
--- /dev/null
+++ b/gnu/usr.bin/perl/t/lib/Count.pm
@@ -0,0 +1,8 @@
+# zero! ha ha ha
+package Count;
+"ha!";
+__DATA__
+one! ha ha ha
+two! ha ha ha
+three! ha ha ha
+four! ha ha ha
diff --git a/gnu/usr.bin/perl/t/lib/Devel/nodb.pm b/gnu/usr.bin/perl/t/lib/Devel/nodb.pm
new file mode 100644
index 00000000000..069380f5364
--- /dev/null
+++ b/gnu/usr.bin/perl/t/lib/Devel/nodb.pm
@@ -0,0 +1,3 @@
+package Devel::nodb;
+*DB::DB = sub { } if 0;
+1;
diff --git a/gnu/usr.bin/perl/t/lib/charnames/alias b/gnu/usr.bin/perl/t/lib/charnames/alias
index 75280be7b37..b8786db30c2 100644
--- a/gnu/usr.bin/perl/t/lib/charnames/alias
+++ b/gnu/usr.bin/perl/t/lib/charnames/alias
@@ -12,7 +12,8 @@ unsupported special ':scoobydoo' in charnames at
print "Here: \N{DIGIT ONE}\n";
charnames::vianame("DIGIT TWO");
EXPECT
-Undefined subroutine &charnames::vianame called at - line 2.
+OPTIONS regex
+Undefined subroutine &charnames::vianame called at - line \d+.
Here: 1
########
# NAME autoload doesn't get viacode
@@ -20,7 +21,7 @@ print "Here: \N{DIGIT THREE}\n";
charnames::viacode(0x34);
EXPECT
OPTIONS regex
-Undefined subroutine &charnames::viacode called at - line 2.
+Undefined subroutine &charnames::viacode called at - line \d+.
Here: 3
########
# NAME autoload doesn't get string_vianame
@@ -28,7 +29,7 @@ print "Here: \N{DIGIT FOUR}\n";
charnames::string_vianame("DIGIT FIVE");
EXPECT
OPTIONS regex
-Undefined subroutine &charnames::string_vianame called at - line 2.
+Undefined subroutine &charnames::string_vianame called at - line \d+.
Here: 4
########
# NAME wrong type of alias (missing colon)
@@ -36,8 +37,8 @@ no warnings;
use charnames "alias";
"Here: \N{e_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'e_ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
# NAME alias without an argument
use warnings;
@@ -55,22 +56,14 @@ EXPECT
OPTIONS regex
:alias cannot use existing pragma :full \(reversed order\?\) at
########
-# NAME alias with hashref but no :full
-use warnings;
-use charnames ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE" };
-"Here: \N{e_ACUTE}!\n";
-EXPECT
-OPTIONS regex
-Unknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
-########
# NAME alias with hashref but with :short
use warnings;
no warnings 'void';
use charnames ":short", ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE" };
"Here: \N{e_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
# NAME alias with hashref to :full OK
use warnings;
@@ -96,8 +89,8 @@ no warnings 'void';
use charnames ":loose", ":alias" => { e_ACUTE => "latin SMALL LETTER E WITH ACUTE" };
"Here: \N{e_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'latin SMALL LETTER E WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
# NAME alias with hashref to :short but using :full
use warnings;
@@ -105,8 +98,8 @@ no warnings 'void';
use charnames ":full", ":alias" => { e_ACUTE => "LATIN:e WITH ACUTE" };
"Here: \N{e_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN:e WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
# NAME alias with hashref to :short OK
use warnings;
@@ -152,8 +145,8 @@ use charnames ":short", ":alias" => {
};
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname '' at
+OPTIONS regex fatal
+Unknown charname 'a_ACUTE' at - line \d+, within string
########
# NAME alias with hashref two aliases
use warnings;
@@ -175,8 +168,8 @@ use charnames ":short", ":alias" => {
};
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN SMALL LETTER A WITH ACUT' at
+OPTIONS regex fatal
+Unknown charname 'a_ACUTE' at - line \d+, within string
########
# NAME alias with hashref using mixed aliases
use warnings;
@@ -186,8 +179,8 @@ use charnames ":short", ":alias" => {
};
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN SMALL LETTER A WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'a_ACUTE' at - line \d+, within string
########
# NAME alias with hashref using mixed aliases
use warnings;
@@ -198,8 +191,8 @@ use charnames ":full", ":alias" => {
};
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN:e WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
# NAME alias with nonexisting file
use warnings;
@@ -217,7 +210,7 @@ use charnames ":full", ":alias" => "xy 7-";
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
OPTIONS regex
-Charnames alias files can only have identifier characters at
+Charnames alias file names can only have identifier characters at
########
# NAME alias with non_absolute (existing) file name (which it should /not/ use)
use warnings;
@@ -228,7 +221,7 @@ EXPECT
OPTIONS regex
unicore/perl_alias.pl cannot be used as alias file for charnames at
########
-# alias with bad file
+# NAME alias with bad file
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
0;
@@ -241,7 +234,7 @@ EXPECT
OPTIONS regex
unicore/xyzzy_alias.pl did not return a \(valid\) list of alias pairs at
########
-# alias with file with empty list
+# NAME alias with file with empty list
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
();
@@ -251,10 +244,10 @@ no warnings 'void';
use charnames ":full", ":alias" => "xyzzy";
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'e_ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
-# alias with file OK but file has :short aliases
+# NAME alias with file OK but file has :short aliases
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
( e_ACUTE => "LATIN:e WITH ACUTE",
@@ -266,10 +259,10 @@ no warnings 'void';
use charnames ":full", ":alias" => "xyzzy";
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN:e WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
-# alias with :short and file OK
+# NAME alias with :short and file OK
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
( e_ACUTE => "LATIN:e WITH ACUTE",
@@ -284,7 +277,7 @@ EXPECT
OPTIONS regex
$
########
-# alias with :short and file OK has :long aliases
+# NAME alias with :short and file OK has :long aliases
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
( e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE",
@@ -296,10 +289,10 @@ no warnings 'void';
use charnames ":short", ":alias" => "xyzzy";
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
-# alias with file implicit :full but file has :short aliases
+# NAME alias with file implicit :full but file has :short aliases
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
( e_ACUTE => "LATIN:e WITH ACUTE",
@@ -311,10 +304,10 @@ no warnings 'void';
use charnames ":alias" => ":xyzzy";
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-OPTIONS regex
-Unknown charname 'LATIN:e WITH ACUTE' at
+OPTIONS regex fatal
+Unknown charname 'e_ACUTE' at - line \d+, within string
########
-# alias with file implicit :full and file has :long aliases
+# NAME alias with file implicit :full and file has :long aliases
--FILE-- ../../lib/unicore/xyzzy_alias.pl
#!perl
( e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE",
@@ -346,3 +339,68 @@ print charnames::viacode(0x80), "\n";
EXPECT
OPTIONS regex
PADDING CHARACTER
+########
+# NAME various wrong characters in :alias are errors
+# Below, one of the EXPECT regexes matches both the UTF-8 and non-UTF-8 form.
+# This is because under some circumstances the message gets output as UTF-8.
+use charnames ":full", ":alias" => {
+ "4e_ACUTE" => "LATIN SMALL LETTER E WITH ACUTE",
+ "e_A,CUTE" => "LATIN SMALL LETTER E WITH ACUTE",
+ "e_ACUT\x{d7}E" => "LATIN SMALL LETTER E WITH ACUTE",
+ };
+EXPECT
+OPTIONS regex
+Invalid character in charnames alias definition; marked by <-- HERE in '4<-- HERE e_ACUTE'
+Invalid character in charnames alias definition; marked by <-- HERE in 'e_A,<-- HERE CUTE'
+Invalid character in charnames alias definition; marked by <-- HERE in 'e_ACUT(?:\x{d7}|\x{C3}\x{97})<-- HERE E'
+########
+# RT#73022
+# NAME \N{...} interprets ... as octets rather than UTF-8
+use utf8;
+use open qw( :utf8 :std );
+use charnames ":full", ":alias" => { "自転車に乗る人" => "BICYCLIST" };
+print "ok\n" if "\N{自転車に乗る人}" eq "\x{1F6B4}";
+EXPECT
+ok
+########
+# NAME Misspelled \N{} UTF-8 names are errors
+use utf8;
+use open qw( :utf8 :std );
+use charnames ":full", ":alias" => { "自転車に乗る人" => "BICYCLIST" };
+print "ok\n" if "\N{転車に乗る人}" eq "\x{1F6B4}";
+EXPECT
+OPTIONS regex
+Unknown charname '転車に乗る人' at - line \d+, within string
+########
+# NAME various wrong UTF-8 characters in :alias are errors
+# First has a punctuation, KATAKANA MIDDLE DOT, in it; second begins with a
+# digit: ARABIC-INDIC DIGIT FOUR
+use utf8;
+use open qw( :utf8 :std );
+use charnames ":full", ":alias" => { "自転車・に乗る人" => "BICYCLIST",
+ "٤転車に乗る人" => "BICYCLIST",
+ };
+print "ok\n" if "\N{自転車・に乗る人}" eq "\x{1F6B4}";
+print "ok\n" if "\N{٤転車に乗る人}" eq "\x{1F6B4}";
+EXPECT
+OPTIONS regex
+Invalid character in charnames alias definition; marked by <-- HERE in '٤<-- HERE 転車に乗る人'
+Invalid character in charnames alias definition; marked by <-- HERE in '自転車・<-- HERE に乗る人' at - line \d+
+########
+# NAME trailing and sequences of multiple spaces in :alias names are deprectated
+use charnames ":alias" => { "TOO MANY SPACES" => "NO ENTRY SIGN",
+ "TRAILING SPACE " => "FACE WITH NO GOOD GESTURE"
+ };
+print "ok\n" if "\N{TOO MANY SPACES}" eq "\x{1F6AB}";
+print "ok\n" if "\N{TRAILING SPACE }" eq "\x{1F645}";
+no warnings 'deprecated';
+print "ok\n" if "\N{TOO MANY SPACES}" eq "\x{1F6AB}";
+print "ok\n" if "\N{TRAILING SPACE }" eq "\x{1F645}";
+EXPECT
+OPTIONS regex
+A sequence of multiple spaces in a charnames alias definition is deprecated; marked by <-- HERE in 'TOO <-- HERE MANY SPACES' at - line \d+.
+Trailing white-space in a charnames alias definition is deprecated; marked by <-- HERE in 'TRAILING SPACE <-- HERE ' at - line \d+.
+ok
+ok
+ok
+ok
diff --git a/gnu/usr.bin/perl/t/lib/common.pl b/gnu/usr.bin/perl/t/lib/common.pl
index e6a33b20242..beb59a021d4 100644
--- a/gnu/usr.bin/perl/t/lib/common.pl
+++ b/gnu/usr.bin/perl/t/lib/common.pl
@@ -54,11 +54,11 @@ foreach my $file (@w_files) {
}
$^X = rel2abs($^X);
+@INC = map { rel2abs($_) } @INC;
my $tempdir = tempfile;
mkdir $tempdir, 0700 or die "Can't mkdir '$tempdir': $!";
chdir $tempdir or die die "Can't chdir '$tempdir': $!";
-unshift @INC, '../../lib';
my $cleanup = 1;
END {
diff --git a/gnu/usr.bin/perl/t/lib/commonsense.t b/gnu/usr.bin/perl/t/lib/commonsense.t
index 27fd302fb19..9f0f13f634c 100644
--- a/gnu/usr.bin/perl/t/lib/commonsense.t
+++ b/gnu/usr.bin/perl/t/lib/commonsense.t
@@ -1,21 +1,26 @@
#!./perl
-chdir 't' if -d 't';
-@INC = '../lib';
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+plan( tests => 1);
+
require Config; import Config;
+
if (($Config{'extensions'} !~ /\bFcntl\b/) ){
- print "Bail out! Perl configured without Fcntl module\n";
- exit 0;
+ BAIL_OUT("Perl configured without Fcntl module");
}
-if (($Config{'extensions'} !~ /\bIO\b/) ){
- print "Bail out! Perl configured without IO module\n";
- exit 0;
+##Finds IO submodules when using \b
+if (($Config{'extensions'} !~ /\bIO\s/) ){
+ BAIL_OUT("Perl configured without IO module");
}
# hey, DOS users do not need this kind of common sense ;-)
if ($^O ne 'dos' && ($Config{'extensions'} !~ /\bFile\/Glob\b/) ){
- print "Bail out! Perl configured without File::Glob module\n";
- exit 0;
+ BAIL_OUT("Perl configured without File::Glob module");
}
-print "1..1\nok 1\n";
+pass('common sense');
diff --git a/gnu/usr.bin/perl/t/lib/croak/op b/gnu/usr.bin/perl/t/lib/croak/op
index eb5974ffc43..22f1e7621b5 100644
--- a/gnu/usr.bin/perl/t/lib/croak/op
+++ b/gnu/usr.bin/perl/t/lib/croak/op
@@ -5,14 +5,6 @@ EXPECT
Can't use global $! in "my" at - line 1, near "my $!"
Execution of - aborted due to compilation errors.
########
-# NAME my $<special_unicode>
-use utf8;
-BEGIN { binmode STDERR, ":utf8" }
-my $♠;
-EXPECT
-Can't use global $♠ in "my" at - line 3, near "my $♠"
-Execution of - aborted due to compilation errors.
-########
# NAME OP_HELEM fields
package Foo;
use fields qw(a b);
@@ -37,11 +29,6 @@ my Foo $f = Foo->new;
EXPECT
No such class field "c" in variable $f of type Foo at - line 8.
########
-# NAME my sub
-my sub foo { }
-EXPECT
-"my sub" not yet implemented at - line 1.
-########
# NAME delete BAD
delete $x;
EXPECT
diff --git a/gnu/usr.bin/perl/t/lib/croak/pp_ctl b/gnu/usr.bin/perl/t/lib/croak/pp_ctl
index 0f075cd783e..ee1edbaffab 100644
--- a/gnu/usr.bin/perl/t/lib/croak/pp_ctl
+++ b/gnu/usr.bin/perl/t/lib/croak/pp_ctl
@@ -1,6 +1,12 @@
__END__
+# NAME dump with computed label
+my $label = "foo";
+dump $label;
+EXPECT
+Can't find label foo at - line 2.
+########
# NAME when outside given
-use 5.01;
+use 5.01; no warnings 'experimental::smartmatch';
when(undef){}
EXPECT
Can't "when" outside a topicalizer at - line 2.
diff --git a/gnu/usr.bin/perl/t/lib/croak/pp_hot b/gnu/usr.bin/perl/t/lib/croak/pp_hot
new file mode 100644
index 00000000000..bc00a484c6d
--- /dev/null
+++ b/gnu/usr.bin/perl/t/lib/croak/pp_hot
@@ -0,0 +1,60 @@
+__END__
+# NAME local %$ref on last line of lvalue sub in lv cx
+ sub foo :lvalue { local %{\%foo} }
+ (foo) = 3;
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME local @$ref on last line of lvalue sub in lv cx
+ sub foo :lvalue { local @{\@foo} }
+ (foo) = 3;
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME local %$ref on last line of lvalue sub in non-lv cx
+ sub foo :lvalue { local %{\%foo} }
+ foo;
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME local @$ref on last line of lvalue sub in non-lv cx
+ sub foo :lvalue { local @{\@foo} }
+ foo;
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME \local %$ref
+ \local %{\%hash}
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME \local @$ref
+ \local @{\@hash}
+EXPECT
+Can't localize through a reference at - line 1.
+########
+# NAME calling undef sub belonging to undef GV
+ my $foosub = \&foo;
+ undef *foo;
+ &$foosub;
+EXPECT
+Undefined subroutine &main::foo called at - line 3.
+########
+# NAME calling undef sub resident in its GV
+ my $foosub = \&foo;
+ &$foosub;
+EXPECT
+Undefined subroutine &main::foo called at - line 2.
+########
+# NAME calling undef scalar
+ &{+undef};
+EXPECT
+Can't use an undefined value as a subroutine reference at - line 1.
+########
+# NAME calling undef magical scalar
+ sub TIESCALAR {bless[]}
+ sub FETCH {}
+ tie $tied, "";
+ &$tied;
+EXPECT
+Can't use an undefined value as a subroutine reference at - line 4.
diff --git a/gnu/usr.bin/perl/t/lib/croak/toke b/gnu/usr.bin/perl/t/lib/croak/toke
new file mode 100644
index 00000000000..8e4b0338a30
--- /dev/null
+++ b/gnu/usr.bin/perl/t/lib/croak/toke
@@ -0,0 +1,130 @@
+__END__
+# NAME Unterminated here-doc in string eval
+eval "<<foo"; die $@
+EXPECT
+Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
+########
+# NAME Unterminated here-doc in s/// string eval
+eval "s//<<foo/e"; die $@
+EXPECT
+Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
+########
+# NAME Missing name in "my sub"
+use feature 'lexical_subs'; my sub;
+EXPECT
+The lexical_subs feature is experimental at - line 1.
+Missing name in "my sub" at - line 1.
+########
+# NAME Missing name in "our sub"
+use feature 'lexical_subs'; our sub;
+EXPECT
+The lexical_subs feature is experimental at - line 1.
+Missing name in "our sub" at - line 1.
+########
+# NAME Missing name in "state sub"
+use 5.01; use feature 'lexical_subs';
+state sub;
+EXPECT
+The lexical_subs feature is experimental at - line 2.
+Missing name in "state sub" at - line 2.
+########
+# NAME Integer constant overloading returning undef
+use overload;
+BEGIN { overload::constant integer => sub {}; undef *^H }
+1
+EXPECT
+Constant(1) unknown at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME Float constant overloading returning undef
+use overload;
+BEGIN { overload::constant float => sub {}; undef *^H }
+1.1
+EXPECT
+Constant(1.1) unknown at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME Binary constant overloading returning undef
+use overload;
+BEGIN { overload::constant binary => sub {}; undef *^H }
+0x1
+EXPECT
+Constant(0x1) unknown at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME String constant overloading returning undef
+use overload;
+BEGIN { overload::constant q => sub {}; undef *^H }
+'1', "1$_", tr"a"", s""a"
+EXPECT
+Constant(q) unknown at - line 3, near "'1'"
+Constant(qq) unknown at - line 3, within string
+Constant(tr) unknown at - line 3, within string
+Constant(s) unknown at - line 3, within string
+Execution of - aborted due to compilation errors.
+########
+# NAME Regexp constant overloading when *^H is undefined
+use overload;
+BEGIN { overload::constant qr => sub {}; undef *^H }
+/a/, m'a'
+EXPECT
+Constant(qq) unknown at - line 3, within pattern
+Constant(q) unknown at - line 3, within pattern
+Execution of - aborted due to compilation errors.
+########
+# NAME \N{...} when charnames fails to load but without an error
+# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
+BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} }
+"\N{a}"
+EXPECT
+Constant(\N{a}) unknown at - line 2, within string
+Execution of - aborted due to compilation errors.
+########
+# NAME Integer constant overloading returning undef
+use overload;
+BEGIN { overload::constant integer => sub {} }
+1
+EXPECT
+Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME Float constant overloading returning undef
+use overload;
+BEGIN { overload::constant float => sub {} }
+1.1
+EXPECT
+Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME Binary constant overloading returning undef
+use overload;
+BEGIN { overload::constant binary => sub {} }
+0x1
+EXPECT
+Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
+Execution of - aborted due to compilation errors.
+########
+# NAME String constant overloading returning undef
+use overload;
+BEGIN { overload::constant q => sub {} }
+'1', "1$_", tr"a"", s""a"
+EXPECT
+Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'"
+Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string
+Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string
+Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string
+Execution of - aborted due to compilation errors.
+########
+# NAME Regexp constant overloading returning undef
+use overload;
+BEGIN { overload::constant qr => sub {} }
+/a/, m'a'
+EXPECT
+Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
+Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
+Execution of - aborted due to compilation errors.
+########
+# NAME Unterminated delimiter for here document
+<<"foo
+EXPECT
+Unterminated delimiter for here document at - line 1.
diff --git a/gnu/usr.bin/perl/t/lib/feature/switch b/gnu/usr.bin/perl/t/lib/feature/switch
index 5da635b6d51..0dee7f51cf9 100644
--- a/gnu/usr.bin/perl/t/lib/feature/switch
+++ b/gnu/usr.bin/perl/t/lib/feature/switch
@@ -3,28 +3,28 @@ Check the lexical scoping of the switch keywords.
__END__
# No switch; given should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
print STDOUT given;
EXPECT
Unquoted string "given" may clash with future reserved word at - line 3.
given
########
# No switch; when should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
print STDOUT when;
EXPECT
Unquoted string "when" may clash with future reserved word at - line 3.
when
########
# No switch; default should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
print STDOUT default;
EXPECT
Unquoted string "default" may clash with future reserved word at - line 3.
default
########
# No switch; break should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
print STDOUT break;
EXPECT
Unquoted string "break" may clash with future reserved word at - line 3.
@@ -36,19 +36,19 @@ EXPECT
Can't "continue" outside a when block at - line 2.
########
# Use switch; so given is a keyword
-use feature 'switch';
+use feature 'switch'; no warnings 'experimental::smartmatch';
given("okay\n") { print }
EXPECT
okay
########
# Use switch; so when is a keyword
-use feature 'switch';
+use feature 'switch'; no warnings 'experimental::smartmatch';
given(1) { when(1) { print "okay" } }
EXPECT
okay
########
# Use switch; so default is a keyword
-use feature 'switch';
+use feature 'switch'; no warnings 'experimental::smartmatch';
given(1) { default { print "okay" } }
EXPECT
okay
@@ -60,7 +60,7 @@ EXPECT
Can't "break" outside a given block at - line 3.
########
# switch out of scope; given should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) {print "Okay here\n";}
}
@@ -71,7 +71,7 @@ Okay here
given
########
# switch out of scope; when should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
}
@@ -82,7 +82,7 @@ Okay here
when
########
# switch out of scope; default should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { default {print "Okay here\n";} }
}
@@ -93,7 +93,7 @@ Okay here
default
########
# switch out of scope; break should be a bareword.
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { break }
}
@@ -103,7 +103,7 @@ Unquoted string "break" may clash with future reserved word at - line 6.
break
########
# C<no feature 'switch'> should work
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
no feature 'switch';
@@ -114,7 +114,7 @@ Okay here
when
########
# C<no feature> should work too
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
no feature;
@@ -125,14 +125,14 @@ Okay here
when
########
# Without the feature, no 'Unambiguous use of' warning:
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
@break = ($break = "break");
print ${break}, ${break[0]};
EXPECT
breakbreak
########
# With the feature, we get an 'Unambiguous use of' warning:
-use warnings;
+use warnings; no warnings 'experimental::smartmatch';
use feature 'switch';
@break = ($break = "break");
print ${break}, ${break[0]};
diff --git a/gnu/usr.bin/perl/t/lib/strict/refs b/gnu/usr.bin/perl/t/lib/strict/refs
index d9bff7cd840..e74851220e7 100644
--- a/gnu/usr.bin/perl/t/lib/strict/refs
+++ b/gnu/usr.bin/perl/t/lib/strict/refs
@@ -27,6 +27,29 @@ Can't use string ("A::Really::Big::Package::Name::T"...) as a HASH ref while "st
# strict refs - error
use strict ;
+"A::Really::Big::Package::Name::To::Use" =~ /(.*)/;
+${$1};
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a SCALAR ref while "strict refs" in use at - line 5.
+########
+
+# strict refs - error
+use strict ;
+*{"A::Really::Big::Package::Name::To::Use"; }
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a symbol ref while "strict refs" in use at - line 4.
+########
+
+# strict refs - error
+use strict ;
+"A::Really::Big::Package::Name::To::Use" =~ /(.*)/;
+*{$1}
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a symbol ref while "strict refs" in use at - line 5.
+########
+
+# strict refs - error
+use strict ;
my $fred ;
my $a = ${"fred"} ;
EXPECT
@@ -308,7 +331,7 @@ Can't use string ("Fred") as a SCALAR ref while "strict refs" in use at - line 8
use strict 'refs';
/(?{${"foo"}++})/;
EXPECT
-Can't use string ("foo") as a SCALAR ref while "strict refs" in use at (re_eval 1) line 1.
+Can't use string ("foo") as a SCALAR ref while "strict refs" in use at - line 3.
########
# [perl #37886] strict 'refs' doesn't apply inside defined
use strict 'refs';
diff --git a/gnu/usr.bin/perl/t/lib/strict/subs b/gnu/usr.bin/perl/t/lib/strict/subs
index 57327cca0bb..5fd0b03de7f 100644
--- a/gnu/usr.bin/perl/t/lib/strict/subs
+++ b/gnu/usr.bin/perl/t/lib/strict/subs
@@ -378,8 +378,8 @@ Execution of - aborted due to compilation errors.
use strict 'subs';
qr/(?{my $x=foo})/;
EXPECT
-Bareword "foo" not allowed while "strict subs" in use at (re_eval 1) line 1.
-Compilation failed in regexp at - line 3.
+Bareword "foo" not allowed while "strict subs" in use at - line 3.
+Execution of - aborted due to compilation errors.
########
# Regexp compilation errors weren't UTF-8 clean
use strict 'subs';
@@ -387,8 +387,8 @@ use utf8;
use open qw( :utf8 :std );
qr/(?{my $x=fòò})/;
EXPECT
-Bareword "fòò" not allowed while "strict subs" in use at (re_eval 1) line 1.
-Compilation failed in regexp at - line 5.
+Bareword "fòò" not allowed while "strict subs" in use at - line 5.
+Execution of - aborted due to compilation errors.
########
# [perl #27628] strict 'subs' didn't warn on bareword array index
use strict 'subs';
@@ -451,3 +451,10 @@ sub foo {
EXPECT
Bareword "FOO" not allowed while "strict subs" in use at - line 5.
Execution of - aborted due to compilation errors.
+########
+# make sure checks are done within (?{})
+use strict 'subs';
+/(?{FOO})/
+EXPECT
+Bareword "FOO" not allowed while "strict subs" in use at - line 3.
+Execution of - aborted due to compilation errors.
diff --git a/gnu/usr.bin/perl/t/lib/strict/vars b/gnu/usr.bin/perl/t/lib/strict/vars
index 87e5a773309..c6cb0679396 100644
--- a/gnu/usr.bin/perl/t/lib/strict/vars
+++ b/gnu/usr.bin/perl/t/lib/strict/vars
@@ -518,8 +518,8 @@ Execution of - aborted due to compilation errors.
use strict 'vars';
qr/(?{$foo++})/;
EXPECT
-Global symbol "$foo" requires explicit package name at (re_eval 1) line 1.
-Compilation failed in regexp at - line 3.
+Global symbol "$foo" requires explicit package name at - line 3.
+Execution of - aborted due to compilation errors.
########
# Regex compilation errors weren't UTF-8 clean.
use strict 'vars';
@@ -527,8 +527,8 @@ use utf8;
use open qw( :utf8 :std );
qr/(?{$fòò++})/;
EXPECT
-Global symbol "$fòò" requires explicit package name at (re_eval 1) line 1.
-Compilation failed in regexp at - line 5.
+Global symbol "$fòò" requires explicit package name at - line 5.
+Execution of - aborted due to compilation errors.
########
# [perl #73712] 'Variable is not imported' should be suppressible
$dweck;
diff --git a/gnu/usr.bin/perl/t/lib/test_require.pm b/gnu/usr.bin/perl/t/lib/test_require.pm
new file mode 100644
index 00000000000..381e068c854
--- /dev/null
+++ b/gnu/usr.bin/perl/t/lib/test_require.pm
@@ -0,0 +1,6 @@
+#!perl -w
+# Don't use strict because this is for testing require
+
+package test_require;
+
+++$test_require::loaded;
diff --git a/gnu/usr.bin/perl/t/lib/universal.t b/gnu/usr.bin/perl/t/lib/universal.t
index a52e01972fe..71223b4faef 100644
--- a/gnu/usr.bin/perl/t/lib/universal.t
+++ b/gnu/usr.bin/perl/t/lib/universal.t
@@ -15,12 +15,10 @@ sub tryit { eval shift or warn \$@ }
tryit "&Internals::SvREADONLY($arg)";
tryit "&Internals::SvREFCNT($arg)";
tryit "&Internals::hv_clear_placeholders($arg)";
-tryit "&Internals::HvREHASH($arg)";
----
Usage: Internals::SvREADONLY(SCALAR[, ON]) at (eval 1) line 1.
Usage: Internals::SvREFCNT(SCALAR[, REFCOUNT]) at (eval 2) line 1.
Usage: Internals::hv_clear_placeholders(hv) at (eval 3) line 1.
-Internals::HvREHASH $hashref at (eval 4) line 1.
====
}
diff --git a/gnu/usr.bin/perl/t/lib/warnings/2use b/gnu/usr.bin/perl/t/lib/warnings/2use
index e5a8103b810..c0d203a399d 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/2use
+++ b/gnu/usr.bin/perl/t/lib/warnings/2use
@@ -358,3 +358,22 @@ $a =+ 1 ;
EXPECT
Reversed += operator at - line 6.
Use of uninitialized value $c in scalar chop at - line 9.
+########
+
+# Check that deprecation warnings are not implicitly disabled by use
+$*;
+use warnings "void";
+$#;
+EXPECT
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 5.
+Useless use of a variable in void context at - line 5.
+########
+
+# Check that deprecation warnings are not implicitly disabled by no
+$*;
+no warnings "void";
+$#;
+EXPECT
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 5.
diff --git a/gnu/usr.bin/perl/t/lib/warnings/9uninit b/gnu/usr.bin/perl/t/lib/warnings/9uninit
index 37e24e73859..829e2de8386 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/9uninit
+++ b/gnu/usr.bin/perl/t/lib/warnings/9uninit
@@ -820,6 +820,7 @@ undef $g1;
$m1 = '$g1';
$foo =~ s//$m1/ee;
EXPECT
+Use of my $_ is experimental at - line 16.
Use of uninitialized value $_ in pattern match (m//) at - line 5.
Use of uninitialized value $m1 in regexp compilation at - line 6.
Use of uninitialized value $_ in pattern match (m//) at - line 6.
@@ -830,9 +831,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 10.
Use of uninitialized value $_ in substitution (s///) at - line 10.
Use of uninitialized value $_ in substitution (s///) at - line 10.
Use of uninitialized value $_ in substitution (s///) at - line 11.
-Use of uninitialized value $g1 in substitution (s///) at - line 11.
Use of uninitialized value $_ in substitution (s///) at - line 11.
-Use of uninitialized value $g1 in substitution (s///) at - line 11.
+Use of uninitialized value $g1 in substitution iterator at - line 11.
Use of uninitialized value $m1 in regexp compilation at - line 12.
Use of uninitialized value $_ in substitution (s///) at - line 12.
Use of uninitialized value $_ in substitution (s///) at - line 12.
@@ -849,9 +849,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 21.
Use of uninitialized value $_ in substitution (s///) at - line 21.
Use of uninitialized value $_ in substitution (s///) at - line 21.
Use of uninitialized value $_ in substitution (s///) at - line 22.
-Use of uninitialized value $g1 in substitution (s///) at - line 22.
Use of uninitialized value $_ in substitution (s///) at - line 22.
-Use of uninitialized value $g1 in substitution (s///) at - line 22.
+Use of uninitialized value $g1 in substitution iterator at - line 22.
Use of uninitialized value $m1 in regexp compilation at - line 23.
Use of uninitialized value $_ in substitution (s///) at - line 23.
Use of uninitialized value $_ in substitution (s///) at - line 23.
@@ -868,9 +867,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 31.
Use of uninitialized value $g2 in substitution (s///) at - line 31.
Use of uninitialized value $g2 in substitution (s///) at - line 31.
Use of uninitialized value $g2 in substitution (s///) at - line 32.
-Use of uninitialized value $g1 in substitution (s///) at - line 32.
Use of uninitialized value $g2 in substitution (s///) at - line 32.
-Use of uninitialized value $g1 in substitution (s///) at - line 32.
+Use of uninitialized value $g1 in substitution iterator at - line 32.
Use of uninitialized value $m1 in regexp compilation at - line 33.
Use of uninitialized value $g2 in substitution (s///) at - line 33.
Use of uninitialized value $g2 in substitution (s///) at - line 33.
@@ -880,10 +878,10 @@ Use of uninitialized value in transliteration (tr///) at - line 35.
Use of uninitialized value $m1 in regexp compilation at - line 38.
Use of uninitialized value $g1 in regexp compilation at - line 39.
Use of uninitialized value $m1 in regexp compilation at - line 41.
-Use of uninitialized value $g1 in substitution (s///) at - line 42.
+Use of uninitialized value $g1 in substitution iterator at - line 42.
Use of uninitialized value $m1 in regexp compilation at - line 43.
Use of uninitialized value $g1 in substitution iterator at - line 43.
-Use of uninitialized value $m1 in substitution iterator at - line 44.
+Use of uninitialized value $m1 in substitution (s///) at - line 44.
Use of uninitialized value in substitution iterator at - line 47.
########
use warnings 'uninitialized';
@@ -1035,7 +1033,6 @@ Use of uninitialized value $g1 in vec at - line 11.
Use of uninitialized value $m1 in vec at - line 11.
Use of uninitialized value $m2 in vec at - line 12.
Use of uninitialized value $g1 in vec at - line 12.
-Use of uninitialized value $m1 in vec at - line 12.
Use of uninitialized value $m1 in index at - line 14.
Use of uninitialized value $m2 in index at - line 14.
Use of uninitialized value $g1 in index at - line 15.
@@ -1144,8 +1141,8 @@ our @foo3=(1,undef); chop @foo3;
my @foo4=(1,undef); chop @foo4;
our @foo5=(1,undef); $v = sprintf "%s%s",@foo5;
my @foo6=(1,undef); $v = sprintf "%s%s",@foo6;
-our %foo7=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo7;
-my %foo8=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo8;
+our %foo7=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s%s%s",%foo7;
+my %foo8=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s%s%s",%foo8;
our @foo9 =(1,undef); $v = sprintf "%s%s%s%s",$m1,@foo9, $ma[2];
my @foo10=(1,undef); $v = sprintf "%s%s%s%s",$m2,@foo10,$ma[2];
our %foo11=('foo'=>'bar','baz'=>undef); $v = join '', %foo11;
@@ -1226,8 +1223,6 @@ Use of uninitialized value $m1 in splice at - line 10.
Use of uninitialized value $g1 in splice at - line 10.
Use of uninitialized value in addition (+) at - line 10.
Use of uninitialized value $m1 in method lookup at - line 13.
-Use of uninitialized value in subroutine entry at - line 15.
-Use of uninitialized value in subroutine entry at - line 16.
Use of uninitialized value $m1 in warn at - line 18.
Use of uninitialized value $g1 in warn at - line 18.
foo at - line 18.
@@ -1962,7 +1957,7 @@ $v = 1 + prototype $fn;
EXPECT
Use of uninitialized value in addition (+) at - line 4.
########
-use warnings 'uninitialized';
+use warnings 'uninitialized'; no warnings 'experimental::smartmatch';
my $v;
my $fn = sub {};
$v = 1 + (1 ~~ $fn);
@@ -2037,3 +2032,58 @@ use warnings 'uninitialized';
"@{[ $x ]}";
EXPECT
Use of uninitialized value in join or string at - line 3.
+########
+# inside formats
+use warnings 'uninitialized';
+my $x;
+format =
+@
+"$x";
+.
+write;
+EXPECT
+Use of uninitialized value $x in string at - line 6.
+########
+# NAME off-by-one error in hash bucket walk in key detection logic
+use warnings 'uninitialized';
+
+for ( 0 .. 20 ) { # we assume that this means we test keys for every bucket
+ my %h= ( $_ => undef );
+ my $s= sprintf "%s", $h{$_};
+}
+EXPECT
+Use of uninitialized value $h{"0"} in sprintf at - line 5.
+Use of uninitialized value $h{"1"} in sprintf at - line 5.
+Use of uninitialized value $h{"2"} in sprintf at - line 5.
+Use of uninitialized value $h{"3"} in sprintf at - line 5.
+Use of uninitialized value $h{"4"} in sprintf at - line 5.
+Use of uninitialized value $h{"5"} in sprintf at - line 5.
+Use of uninitialized value $h{"6"} in sprintf at - line 5.
+Use of uninitialized value $h{"7"} in sprintf at - line 5.
+Use of uninitialized value $h{"8"} in sprintf at - line 5.
+Use of uninitialized value $h{"9"} in sprintf at - line 5.
+Use of uninitialized value $h{"10"} in sprintf at - line 5.
+Use of uninitialized value $h{"11"} in sprintf at - line 5.
+Use of uninitialized value $h{"12"} in sprintf at - line 5.
+Use of uninitialized value $h{"13"} in sprintf at - line 5.
+Use of uninitialized value $h{"14"} in sprintf at - line 5.
+Use of uninitialized value $h{"15"} in sprintf at - line 5.
+Use of uninitialized value $h{"16"} in sprintf at - line 5.
+Use of uninitialized value $h{"17"} in sprintf at - line 5.
+Use of uninitialized value $h{"18"} in sprintf at - line 5.
+Use of uninitialized value $h{"19"} in sprintf at - line 5.
+Use of uninitialized value $h{"20"} in sprintf at - line 5.
+########
+# NAME SvPOK && SvLEN==0 should not produce uninit warning
+use warnings 'uninitialized';
+
+$v = int(${qr||}); # sv_2iv on a regexp
+$v = 1.1 * ${qr||}; # sv_2nv on a regexp
+$v = ${qr||} << 2; # sv_2uv on a regexp
+
+sub TIESCALAR{bless[]}
+sub FETCH {${qr||}}
+tie $t, "";
+$v = 1.1 * $t; # sv_2nv on a tied regexp
+
+EXPECT
diff --git a/gnu/usr.bin/perl/t/lib/warnings/doio b/gnu/usr.bin/perl/t/lib/warnings/doio
index 732f66d3184..37b55e3e770 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/doio
+++ b/gnu/usr.bin/perl/t/lib/warnings/doio
@@ -159,10 +159,16 @@ Unsuccessful stat on filename containing newline at - line 4.
# doio.c [Perl_my_stat]
use warnings 'io';
-l STDIN;
+-l $fh;
+open $fh, $0 or die "# $!";
+-l $fh;
no warnings 'io';
-l STDIN;
+-l $fh;
+close $fh;
EXPECT
Use of -l on filehandle STDIN at - line 3.
+Use of -l on filehandle $fh at - line 6.
########
# doio.c [Perl_my_stat]
use utf8;
diff --git a/gnu/usr.bin/perl/t/lib/warnings/gv b/gnu/usr.bin/perl/t/lib/warnings/gv
index 6101f691320..6b022e1294c 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/gv
+++ b/gnu/usr.bin/perl/t/lib/warnings/gv
@@ -63,6 +63,56 @@ $# is no longer supported at - line 2.
$* is no longer supported at - line 3.
########
# gv.c
+$a = ${#};
+$a = ${*};
+no warnings 'deprecated' ;
+$a = ${#};
+$a = ${*};
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+########
+# gv.c
+$a = $#;
+$a = $*;
+$# = $a;
+$* = $a;
+$a = \$#;
+$a = \$*;
+no warnings 'deprecated' ;
+$a = $#;
+$a = $*;
+$# = $a;
+$* = $a;
+$a = \$#;
+$a = \$*;
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 4.
+$* is no longer supported at - line 5.
+$# is no longer supported at - line 6.
+$* is no longer supported at - line 7.
+########
+# gv.c
+@a = @#;
+@a = @*;
+$a = $#;
+$a = $*;
+EXPECT
+$# is no longer supported at - line 4.
+$* is no longer supported at - line 5.
+########
+# gv.c
+$a = $#;
+$a = $*;
+@a = @#;
+@a = @*;
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+########
+# gv.c
use warnings 'syntax' ;
use utf8;
use open qw( :utf8 :std );
diff --git a/gnu/usr.bin/perl/t/lib/warnings/op b/gnu/usr.bin/perl/t/lib/warnings/op
index de74d2e3604..83d3705f560 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/op
+++ b/gnu/usr.bin/perl/t/lib/warnings/op
@@ -1,5 +1,8 @@
op.c AOK
+ Use of my $_ is experimental
+ my $_ ;
+
Found = in conditional, should be ==
1 if $a = 1 ;
@@ -73,6 +76,8 @@
(Maybe you should just omit the defined()?)
my %h ; defined %h ;
+ "my %s" used in sort comparison
+
$[ used in comparison (did you mean $] ?)
length() used on @array (did you mean "scalar(@array)"?)
@@ -97,18 +102,33 @@
sub fred() ;
sub fred($) {}
- Runaway prototype [newSUB] TODO
oops: oopsAV [oopsAV] TODO
oops: oopsHV [oopsHV] TODO
__END__
# op.c
+use warnings 'experimental::lexical_topic' ;
+my $_;
+CORE::state $_;
+no warnings 'experimental::lexical_topic' ;
+my $_;
+CORE::state $_;
+EXPECT
+Use of my $_ is experimental at - line 3.
+Use of state $_ is experimental at - line 4.
+########
+# op.c
use warnings 'syntax' ;
1 if $a = 1 ;
+1 if $a
+ = 1 ;
no warnings 'syntax' ;
1 if $a = 1 ;
+1 if $a
+ = 1 ;
EXPECT
Found = in conditional, should be == at - line 3.
+Found = in conditional, should be == at - line 4.
########
# op.c
use warnings 'syntax' ;
@@ -148,8 +168,10 @@ Using an array as a reference is deprecated at - line 9.
Using an array as a reference is deprecated at - line 10.
########
# op.c
-use warnings 'void' ; close STDIN ;
-1 x 3 ; # OP_REPEAT
+use warnings 'void' ; no warnings 'experimental::smartmatch'; close STDIN ;
+#line 2
+1 x 3 ; # OP_REPEAT (folded)
+(1) x 3 ; # OP_REPEAT
# OP_GVSV
wantarray ; # OP_WANTARRAY
# OP_GV
@@ -206,6 +228,7 @@ $a <=> $b; # OP_NCMP
use 5.015;
__SUB__ # OP_RUNCV
EXPECT
+Useless use of a constant ("111") in void context at - line 2.
Useless use of repeat (x) in void context at - line 3.
Useless use of wantarray in void context at - line 5.
Useless use of reference-type operator in void context at - line 12.
@@ -660,28 +683,43 @@ Bareword found in conditional at - line 3.
use warnings 'misc' ;
open FH, "<abc" ;
$x = 1 if $x = <FH> ;
+$x = 1 if $x
+ = <FH> ;
no warnings 'misc' ;
$x = 1 if $x = <FH> ;
+$x = 1 if $x
+ = <FH> ;
EXPECT
Value of <HANDLE> construct can be "0"; test with defined() at - line 4.
+Value of <HANDLE> construct can be "0"; test with defined() at - line 5.
########
# op.c
use warnings 'misc' ;
opendir FH, "." ;
$x = 1 if $x = readdir FH ;
+$x = 1 if $x
+ = readdir FH ;
no warnings 'misc' ;
$x = 1 if $x = readdir FH ;
+$x = 1 if $x
+ = readdir FH ;
closedir FH ;
EXPECT
Value of readdir() operator can be "0"; test with defined() at - line 4.
+Value of readdir() operator can be "0"; test with defined() at - line 5.
########
# op.c
use warnings 'misc' ;
$x = 1 if $x = <*> ;
+$x = 1 if $x
+ = <*> ;
no warnings 'misc' ;
$x = 1 if $x = <*> ;
+$x = 1 if $x
+ = <*> ;
EXPECT
Value of glob construct can be "0"; test with defined() at - line 3.
+Value of glob construct can be "0"; test with defined() at - line 4.
########
# op.c
use warnings 'misc' ;
@@ -722,10 +760,15 @@ EXPECT
use warnings 'redefine' ;
sub fred {}
sub fred {}
+sub fred { # warning should be for this line
+}
no warnings 'redefine' ;
sub fred {}
+sub fred {
+}
EXPECT
Subroutine fred redefined at - line 4.
+Subroutine fred redefined at - line 5.
########
# op.c
use warnings 'redefine' ;
@@ -749,6 +792,28 @@ EXPECT
Constant subroutine main::fred redefined at - line 3.
########
# op.c
+use feature "lexical_subs", "state";
+my sub fred () { 1 }
+sub fred { 2 };
+my sub george { 1 }
+sub george () { 2 } # should *not* produce redef warnings by default
+state sub phred () { 1 }
+sub phred { 2 };
+state sub jorge { 1 }
+sub jorge () { 2 } # should *not* produce redef warnings by default
+EXPECT
+The lexical_subs feature is experimental at - line 3.
+Prototype mismatch: sub fred () vs none at - line 4.
+Constant subroutine fred redefined at - line 4.
+The lexical_subs feature is experimental at - line 5.
+Prototype mismatch: sub george: none vs () at - line 6.
+The lexical_subs feature is experimental at - line 7.
+Prototype mismatch: sub phred () vs none at - line 8.
+Constant subroutine phred redefined at - line 8.
+The lexical_subs feature is experimental at - line 9.
+Prototype mismatch: sub jorge: none vs () at - line 10.
+########
+# op.c
no warnings 'redefine' ;
sub fred () { 1 }
sub fred () { 2 }
@@ -840,8 +905,13 @@ EXPECT
# op.c
sub fred();
sub fred($) {}
+use constant foo=>bar; sub foo(@);
+use constant bav=>bar; sub bav(); # no warning
+sub btu; sub btu();
EXPECT
Prototype mismatch: sub main::fred () vs ($) at - line 3.
+Prototype mismatch: sub foo () vs (@) at - line 4.
+Prototype mismatch: sub btu: none vs () at - line 6.
########
# op.c
use utf8;
@@ -926,6 +996,116 @@ Prototype mismatch: sub main::fred () vs ($) at - line 4.
Prototype mismatch: sub main::freD () vs ($) at - line 11.
Prototype mismatch: sub main::FRED () vs ($) at - line 14.
########
+# op.c [S_simplify_sort]
+# [perl #86136]
+my @tests = split /^/, '
+ sort {$a <=> $b} @a;
+ sort {$a cmp $b} @a;
+ { use integer; sort {$a <=> $b} @a}
+ sort {$b <=> $a} @a;
+ sort {$b cmp $a} @a;
+ { use integer; sort {$b <=> $a} @a}
+';
+for my $pragma ('use warnings "syntax";', '') {
+ for my $vars ('', 'my $a;', 'my $b;', 'my ($a,$b);') {
+ for my $inner_stmt ('', 'print;', 'func();') {
+ eval "#line " . ++$line . "01 -\n$pragma\n$vars"
+ . join "", map s/sort \{\K/$inner_stmt/r, @tests;
+ $@ and die;
+ }
+ }
+}
+sub func{}
+use warnings 'syntax';
+my $a;
+# These used to be errors!
+sort { ; } $a <=> $b;
+sort { ; } $a, "<=>";
+sort { ; } $a, $cmp;
+sort $a, $b if $cmpany_name;
+sort if $a + $cmp;
+sort @t; $a + $cmp;
+EXPECT
+"my $a" used in sort comparison at - line 403.
+"my $a" used in sort comparison at - line 404.
+"my $a" used in sort comparison at - line 405.
+"my $a" used in sort comparison at - line 406.
+"my $a" used in sort comparison at - line 407.
+"my $a" used in sort comparison at - line 408.
+"my $a" used in sort comparison at - line 503.
+"my $a" used in sort comparison at - line 504.
+"my $a" used in sort comparison at - line 505.
+"my $a" used in sort comparison at - line 506.
+"my $a" used in sort comparison at - line 507.
+"my $a" used in sort comparison at - line 508.
+"my $a" used in sort comparison at - line 603.
+"my $a" used in sort comparison at - line 604.
+"my $a" used in sort comparison at - line 605.
+"my $a" used in sort comparison at - line 606.
+"my $a" used in sort comparison at - line 607.
+"my $a" used in sort comparison at - line 608.
+"my $b" used in sort comparison at - line 703.
+"my $b" used in sort comparison at - line 704.
+"my $b" used in sort comparison at - line 705.
+"my $b" used in sort comparison at - line 706.
+"my $b" used in sort comparison at - line 707.
+"my $b" used in sort comparison at - line 708.
+"my $b" used in sort comparison at - line 803.
+"my $b" used in sort comparison at - line 804.
+"my $b" used in sort comparison at - line 805.
+"my $b" used in sort comparison at - line 806.
+"my $b" used in sort comparison at - line 807.
+"my $b" used in sort comparison at - line 808.
+"my $b" used in sort comparison at - line 903.
+"my $b" used in sort comparison at - line 904.
+"my $b" used in sort comparison at - line 905.
+"my $b" used in sort comparison at - line 906.
+"my $b" used in sort comparison at - line 907.
+"my $b" used in sort comparison at - line 908.
+"my $a" used in sort comparison at - line 1003.
+"my $b" used in sort comparison at - line 1003.
+"my $a" used in sort comparison at - line 1004.
+"my $b" used in sort comparison at - line 1004.
+"my $a" used in sort comparison at - line 1005.
+"my $b" used in sort comparison at - line 1005.
+"my $b" used in sort comparison at - line 1006.
+"my $a" used in sort comparison at - line 1006.
+"my $b" used in sort comparison at - line 1007.
+"my $a" used in sort comparison at - line 1007.
+"my $b" used in sort comparison at - line 1008.
+"my $a" used in sort comparison at - line 1008.
+"my $a" used in sort comparison at - line 1103.
+"my $b" used in sort comparison at - line 1103.
+"my $a" used in sort comparison at - line 1104.
+"my $b" used in sort comparison at - line 1104.
+"my $a" used in sort comparison at - line 1105.
+"my $b" used in sort comparison at - line 1105.
+"my $b" used in sort comparison at - line 1106.
+"my $a" used in sort comparison at - line 1106.
+"my $b" used in sort comparison at - line 1107.
+"my $a" used in sort comparison at - line 1107.
+"my $b" used in sort comparison at - line 1108.
+"my $a" used in sort comparison at - line 1108.
+"my $a" used in sort comparison at - line 1203.
+"my $b" used in sort comparison at - line 1203.
+"my $a" used in sort comparison at - line 1204.
+"my $b" used in sort comparison at - line 1204.
+"my $a" used in sort comparison at - line 1205.
+"my $b" used in sort comparison at - line 1205.
+"my $b" used in sort comparison at - line 1206.
+"my $a" used in sort comparison at - line 1206.
+"my $b" used in sort comparison at - line 1207.
+"my $a" used in sort comparison at - line 1207.
+"my $b" used in sort comparison at - line 1208.
+"my $a" used in sort comparison at - line 1208.
+########
+# op.c [S_simplify_sort]
+use warnings 'syntax'; use 5.01;
+state $a;
+sort { $a <=> $b } ();
+EXPECT
+"state $a" used in sort comparison at - line 4.
+########
# op.c [Perl_ck_cmp]
use warnings 'syntax' ;
no warnings 'deprecated';
@@ -1360,3 +1540,24 @@ sub ᚠርƊ () { 1 }
EXPECT
Constant subroutine main::ᚠርƊ redefined at - line 5.
########
+# OPTION regex
+sub DynaLoader::dl_error {};
+use warnings;
+# We're testing that the warnings report the same line number:
+eval <<'EOC' or die $@;
+{
+ DynaLoader::boot_DynaLoader("DynaLoader");
+}
+EOC
+eval <<'EOC' or die $@;
+BEGIN {
+ DynaLoader::boot_DynaLoader("DynaLoader");
+}
+1
+EOC
+EXPECT
+OPTION regex
+\ASubroutine DynaLoader::dl_error redefined at \(eval 1\) line 2\.
+?(?s).*
+Subroutine DynaLoader::dl_error redefined at \(eval 2\) line 2\.
+########
diff --git a/gnu/usr.bin/perl/t/lib/warnings/pad b/gnu/usr.bin/perl/t/lib/warnings/pad
index b226239ab1b..03c4ddb7c06 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/pad
+++ b/gnu/usr.bin/perl/t/lib/warnings/pad
@@ -173,7 +173,7 @@ sub {
}->();
f();
EXPECT
-Variable "$x" is not available at (eval 1) line 2.
+Variable "$x" is not available at (eval 1) line 1.
########
# pad.c
use warnings 'closure' ;
@@ -195,7 +195,7 @@ sub f {
}
f()->();
EXPECT
-Variable "$x" is not available at (eval 1) line 2.
+Variable "$x" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
{
@@ -205,7 +205,7 @@ use warnings 'closure' ;
}
f2();
EXPECT
-Variable "$x" is not available at (eval 1) line 2.
+Variable "$x" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
for my $x (1,2,3) {
@@ -214,7 +214,7 @@ for my $x (1,2,3) {
}
f();
EXPECT
-Variable "$x" is not available at (eval 4) line 2.
+Variable "$x" is not available at (eval 4) line 1.
########
# pad.c
no warnings 'closure' ;
@@ -433,7 +433,7 @@ sub {
}->();
f();
EXPECT
-Variable "$に" is not available at (eval 1) line 2.
+Variable "$に" is not available at (eval 1) line 1.
########
# pad.c
# see bugid 1754
@@ -446,7 +446,7 @@ sub f {
}
f()->();
EXPECT
-Variable "$に" is not available at (eval 1) line 2.
+Variable "$に" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
BEGIN { binmode STDERR, 'utf8'; }
@@ -458,7 +458,7 @@ BEGIN { binmode STDERR, 'utf8'; }
}
f2();
EXPECT
-Variable "$に" is not available at (eval 1) line 2.
+Variable "$に" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
BEGIN { binmode STDERR, 'utf8'; }
@@ -469,7 +469,7 @@ for my $に (1,2,3) {
}
f();
EXPECT
-Variable "$に" is not available at (eval 4) line 2.
+Variable "$に" is not available at (eval 4) line 1.
########
# pad.c
use warnings 'closure' ;
@@ -534,7 +534,7 @@ sub {
}->();
f();
EXPECT
-Variable "$è" is not available at (eval 1) line 2.
+Variable "$è" is not available at (eval 1) line 1.
########
# pad.c
# see bugid 1754
@@ -547,7 +547,7 @@ sub f {
}
f()->();
EXPECT
-Variable "$è" is not available at (eval 1) line 2.
+Variable "$è" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
BEGIN { binmode STDERR, 'utf8'; }
@@ -559,7 +559,7 @@ BEGIN { binmode STDERR, 'utf8'; }
}
f2();
EXPECT
-Variable "$è" is not available at (eval 1) line 2.
+Variable "$è" is not available at (eval 1) line 1.
########
use warnings 'closure' ;
BEGIN { binmode STDERR, 'utf8'; }
@@ -570,5 +570,5 @@ for my $è (1,2,3) {
}
f();
EXPECT
-Variable "$è" is not available at (eval 4) line 2.
+Variable "$è" is not available at (eval 4) line 1.
########
diff --git a/gnu/usr.bin/perl/t/lib/warnings/perl b/gnu/usr.bin/perl/t/lib/warnings/perl
index f619cc6a249..a00ed62b395 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/perl
+++ b/gnu/usr.bin/perl/t/lib/warnings/perl
@@ -223,3 +223,9 @@ BEGIN { $^W = 1 }
$ŷ = 3 ;
EXPECT
Name "ɕლȃṢȿ::ŷ" used only once: possible typo at - line 9.
+########
+
+use warnings 'once';
+$foo++; BEGIN { eval q|@a =~ s///; sub foo;| }
+EXPECT
+Name "main::foo" used only once: possible typo at - line 3.
diff --git a/gnu/usr.bin/perl/t/lib/warnings/perly b/gnu/usr.bin/perl/t/lib/warnings/perly
index d2b95607c00..c912c0ea3c3 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/perly
+++ b/gnu/usr.bin/perl/t/lib/warnings/perly
@@ -8,23 +8,6 @@
sub fred {} $a = "fred" ; do $a()
sub fred {} $a = "fred" ; do $a(1)
- Use of qw(...) as parentheses is deprecated
-
- if qw(a) {}
- unless qw(a) {}
- if (0) {} elsif qw(a) {}
- given qw(a) {}
- when qw(a) {}
- while qw(a) {}
- until qw(a) {}
- foreach $x qw(a b c) {}
- foreach my $x qw(a b c) {}
- $obj->meth qw(a b c)
- do foo qw(a b c)
- do $subref qw(a b c)
- &foo qw(a b c)
- $a[0] qw(a b c)
-
__END__
# perly.y
use warnings 'deprecated' ;
@@ -45,222 +28,3 @@ Use of "do" to call subroutines is deprecated at - line 4.
Use of "do" to call subroutines is deprecated at - line 5.
Use of "do" to call subroutines is deprecated at - line 7.
Use of "do" to call subroutines is deprecated at - line 8.
-########
-use warnings qw(deprecated void);
-if qw(a) { print "x0\n"; } else { }
-if qw(0) { print "x1\n"; } else { }
-if qw(z a) { print "x2\n"; } else { }
-if qw(z 0) { print "x3\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x0
-x2
-########
-if qw() { print "x0\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "if qw()"
-Execution of - aborted due to compilation errors.
-########
-use warnings qw(deprecated void);
-unless qw(a) { print "x0\n"; } else { }
-unless qw(0) { print "x1\n"; } else { }
-unless qw(z a) { print "x2\n"; } else { }
-unless qw(z 0) { print "x3\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x1
-x3
-########
-unless qw() { print "x0\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "unless qw()"
-Execution of - aborted due to compilation errors.
-########
-use warnings qw(deprecated void);
-if(0) { print "eek\n"; } elsif qw(a) { print "x0\n"; } else { }
-if(0) { print "eek\n"; } elsif qw(0) { print "x1\n"; } else { }
-if(0) { print "eek\n"; } elsif qw(z a) { print "x2\n"; } else { }
-if(0) { print "eek\n"; } elsif qw(z 0) { print "x3\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x0
-x2
-########
-if(0) { print "eek\n"; } elsif qw() { print "x0\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "elsif qw()"
-Execution of - aborted due to compilation errors.
-########
-use warnings qw(deprecated void); use feature "switch";
-given qw(a) { print "x0 $_\n"; }
-given qw(z a) { print "x1 $_\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Useless use of a constant ("z") in void context at - line 3.
-x0 a
-x1 a
-########
-use feature "switch";
-given qw() { print "x0\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-syntax error at - line 2, near "given qw()"
-Execution of - aborted due to compilation errors.
-########
-use warnings qw(deprecated void); use feature "switch";
-given("a") { when qw(a) { print "x0\n"; } }
-given("a") { when qw(b) { print "x1\n"; } }
-given("a") { when qw(z a) { print "x2\n"; } }
-given("a") { when qw(z b) { print "x3\n"; } }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x0
-x2
-########
-use feature "switch";
-given("a") { when qw() { print "x0\n"; } }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-syntax error at - line 2, near "when qw()"
-syntax error at - line 2, near "} }"
-Execution of - aborted due to compilation errors.
-########
-use warnings qw(deprecated void);
-while qw(a) { print "x0\n"; last; } {;}
-while qw(0) { print "x1\n"; last; } {;}
-while qw(z a) { print "x2\n"; last; } {;}
-while qw(z 0) { print "x3\n"; last; } {;}
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x0
-x2
-########
-while qw() { print "x0\n"; last; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-x0
-########
-use warnings qw(deprecated void);
-until qw(a) { print "x0\n"; last; } {;}
-until qw(0) { print "x1\n"; last; } {;}
-until qw(z a) { print "x2\n"; last; } {;}
-until qw(z 0) { print "x3\n"; last; } {;}
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of qw(...) as parentheses is deprecated at - line 4.
-Useless use of a constant ("z") in void context at - line 4.
-Use of qw(...) as parentheses is deprecated at - line 5.
-Useless use of a constant ("z") in void context at - line 5.
-x1
-x3
-########
-until qw() { print "x0\n"; } else { }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "until qw()"
-Execution of - aborted due to compilation errors.
-########
-foreach $x qw(a b c) { print $x, "\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-a
-b
-c
-########
-foreach $x qw() { print $x, "\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "$x qw()"
-Execution of - aborted due to compilation errors.
-########
-foreach my $x qw(a b c) { print $x, "\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-a
-b
-c
-########
-foreach my $x qw() { print $x, "\n"; }
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 1.
-syntax error at - line 1, near "$x qw()"
-Execution of - aborted due to compilation errors.
-########
-sub a5c85eef3bf30129e20989e96b099d13::foo { print "+", join(":", @_), "\n"; }
-"a5c85eef3bf30129e20989e96b099d13"->foo qw(); {;}
-"a5c85eef3bf30129e20989e96b099d13"->foo qw(a b c); {;}
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-+a5c85eef3bf30129e20989e96b099d13
-+a5c85eef3bf30129e20989e96b099d13:a:b:c
-########
-sub fd4de2af1449cec72693c36842d41862 { print "+", join(":", @_), "\n"; }
-do fd4de2af1449cec72693c36842d41862 qw(); {;}
-do fd4de2af1449cec72693c36842d41862 qw(a b c); {;}
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of "do" to call subroutines is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of "do" to call subroutines is deprecated at - line 3.
-+
-+a:b:c
-########
-$subref = sub { print "+", join(":", @_), "\n"; };
-do $subref qw();
-do $subref qw(a b c);
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of "do" to call subroutines is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-Use of "do" to call subroutines is deprecated at - line 3.
-+
-+a:b:c
-########
-sub e293a8f7cb38880a48867fcb336448e5 { print "+", join(":", @_), "\n"; }
-&e293a8f7cb38880a48867fcb336448e5 qw();
-&e293a8f7cb38880a48867fcb336448e5 qw(a b c);
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-+
-+a:b:c
-########
-my @a = (sub { print "+", join(":", @_), "\n"; });
-$a[0] qw();
-$a[0] qw(a b c);
-EXPECT
-Use of qw(...) as parentheses is deprecated at - line 2.
-Use of qw(...) as parentheses is deprecated at - line 3.
-+
-+a:b:c
diff --git a/gnu/usr.bin/perl/t/lib/warnings/pp b/gnu/usr.bin/perl/t/lib/warnings/pp
index 89ebcbcbc47..ab8f9516518 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/pp
+++ b/gnu/usr.bin/perl/t/lib/warnings/pp
@@ -37,10 +37,16 @@ use warnings 'substr' ;
$a = "ab" ;
$b = \$a ;
substr($b, 1,1) = "ab" ;
+$b = \$a;
+substr($b, 1,1) = "\x{100}" ;
no warnings 'substr' ;
+$b = \$a;
substr($b, 1,1) = "ab" ;
+$b = \$a;
+substr($b, 1,1) = "\x{100}" ;
EXPECT
Attempt to use reference as lvalue in substr at - line 5.
+Attempt to use reference as lvalue in substr at - line 7.
########
# pp.c
use warnings 'misc' ;
diff --git a/gnu/usr.bin/perl/t/lib/warnings/pp_hot b/gnu/usr.bin/perl/t/lib/warnings/pp_hot
index 9ef68e01eba..ad63d2a935f 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/pp_hot
+++ b/gnu/usr.bin/perl/t/lib/warnings/pp_hot
@@ -61,6 +61,15 @@ EXPECT
print() on unopened filehandle abc at - line 4.
########
# pp_hot.c [pp_print]
+use warnings 'unopened' ;
+$SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; };
+print {"a\0b"} "anc";
+print {"\0b"} "anc";
+EXPECT
+print() on unopened filehandle a\0b at - line 4.
+print() on unopened filehandle \0b at - line 5.
+########
+# pp_hot.c [pp_print]
use warnings 'io' ;
# There is no guarantee that STDOUT is output only, or STDIN input only.
# Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors
@@ -90,6 +99,24 @@ Filehandle FH opened only for input at - line 19.
Filehandle FOO opened only for input at - line 20.
########
# pp_hot.c [pp_print]
+$SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; };
+use warnings 'io' ;
+my $file = "./xcv" ; unlink $file ;
+open (FH, ">$file") or die $! ;
+close FH or die $! ;
+die "There is no file $file" unless -f $file ;
+open ("a\0b", "<$file") or die $! ;
+print {"a\0b"} "anc" ;
+open ("\0b", "<$file") or die $! ;
+print {"\0b"} "anc" ;
+close "a\0b" or die $! ;
+close "\0b" or die $! ;
+unlink $file ;
+EXPECT
+Filehandle a\0b opened only for input at - line 9.
+Filehandle \0b opened only for input at - line 11.
+########
+# pp_hot.c [pp_print]
use warnings 'closed' ;
close STDIN ;
print STDIN "anc";
diff --git a/gnu/usr.bin/perl/t/lib/warnings/regcomp b/gnu/usr.bin/perl/t/lib/warnings/regcomp
index b435d2a1da6..19b6b06f6f4 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/regcomp
+++ b/gnu/usr.bin/perl/t/lib/warnings/regcomp
@@ -1,266 +1,3 @@
- regcomp.c AOK
-
- Quantifier unexpected on zero-length expression [S_study_chunk]
-
- Useless (%s%c) - %suse /%c modifier [S_reg]
- Useless (%sc) - %suse /gc modifier [S_reg]
-
-
-
- Strange *+?{} on zero-length expression [S_study_chunk]
- /(?=a)?/
-
- %.*s matches null string many times [S_regpiece]
- $a = "ABC123" ; $a =~ /(?=a)*/'
-
- /%.127s/: Unrecognized escape \\%c passed through [S_regatom]
- $x = '\m' ; /$x/
-
- POSIX syntax [%c %c] belongs inside character classes [S_checkposixcc]
-
-
- Character class [:%.*s:] unknown [S_regpposixcc]
-
- Character class syntax [%c %c] belongs inside character classes [S_checkposixcc]
-
- /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
-
- /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
-
- /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass]
-
- /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8]
-
- False [] range \"%*.*s\" [S_regclass]
+ regcomp.c These tests have been moved to t/re/reg_mesg.t
__END__
-# regcomp.c [S_regpiece]
-use warnings 'regexp' ;
-my $a = "ABC123" ;
-$a =~ /(?=a)*/ ;
-no warnings 'regexp' ;
-$a =~ /(?=a)*/ ;
-EXPECT
-(?=a)* matches null string many times in regex; marked by <-- HERE in m/(?=a)* <-- HERE / at - line 4.
-########
-# regcomp.c [S_regatom]
-$x = '\m' ;
-use warnings 'regexp' ;
-$a =~ /a$x/ ;
-no warnings 'regexp' ;
-$a =~ /a$x/ ;
-EXPECT
-Unrecognized escape \m passed through in regex; marked by <-- HERE in m/a\m <-- HERE / at - line 4.
-########
-# regcomp.c [S_regatom]
-# The \q should warn, the \_ should NOT warn.
-use warnings 'regexp';
-"foo" =~ /\q/;
-"foo" =~ /\q{/;
-"foo" =~ /a\b{cde/;
-"foo" =~ /a\B{cde/;
-"bar" =~ /\_/;
-no warnings 'regexp';
-"foo" =~ /\q/;
-"foo" =~ /\q{/;
-"foo" =~ /a\b{cde/;
-"foo" =~ /a\B{cde/;
-"bar" =~ /\_/;
-EXPECT
-Unrecognized escape \q passed through in regex; marked by <-- HERE in m/\q <-- HERE / at - line 4.
-Unrecognized escape \q{ passed through in regex; marked by <-- HERE in m/\q{ <-- HERE / at - line 5.
-"\b{" is deprecated; use "\b\{" instead in regex; marked by <-- HERE in m/a\ <-- HERE b{cde/ at - line 6.
-"\B{" is deprecated; use "\B\{" instead in regex; marked by <-- HERE in m/a\ <-- HERE B{cde/ at - line 7.
-########
-# regcomp.c [S_regpposixcc S_checkposixcc]
-#
-use warnings 'regexp' ;
-$_ = "" ;
-/[:alpha:]/;
-/[:zog:]/;
-no warnings 'regexp' ;
-/[:alpha:]/;
-/[:zog:]/;
-EXPECT
-POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:alpha:] <-- HERE / at - line 5.
-POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:zog:] <-- HERE / at - line 6.
-########
-# regcomp.c [S_checkposixcc]
-#
-use warnings 'regexp' ;
-$_ = "" ;
-/[.zog.]/;
-no warnings 'regexp' ;
-/[.zog.]/;
-EXPECT
-POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
-POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
-########
-# regcomp.c [S_regclass]
-$_ = "";
-use warnings 'regexp' ;
-/[a-b]/;
-/[a-\d]/;
-/[\d-b]/;
-/[\s-\d]/;
-/[\d-\s]/;
-/[a-[:digit:]]/;
-/[[:digit:]-b]/;
-/[[:alpha:]-[:digit:]]/;
-/[[:digit:]-[:alpha:]]/;
-no warnings 'regexp' ;
-/[a-b]/;
-/[a-\d]/;
-/[\d-b]/;
-/[\s-\d]/;
-/[\d-\s]/;
-/[a-[:digit:]]/;
-/[[:digit:]-b]/;
-/[[:alpha:]-[:digit:]]/;
-/[[:digit:]-[:alpha:]]/;
-EXPECT
-False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 5.
-False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 6.
-False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 7.
-False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 8.
-False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 9.
-False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 10.
-False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 11.
-False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 12.
-########
-# regcomp.c [S_regclassutf8]
-BEGIN {
- if (ord("\t") == 5) {
- print "SKIPPED\n# ebcdic regular expression ranges differ.";
- exit 0;
- }
-}
-use utf8;
-$_ = "";
-use warnings 'regexp' ;
-/[a-b]/;
-/[a-\d]/;
-/[\d-b]/;
-/[\s-\d]/;
-/[\d-\s]/;
-/[a-[:digit:]]/;
-/[[:digit:]-b]/;
-/[[:alpha:]-[:digit:]]/;
-/[[:digit:]-[:alpha:]]/;
-no warnings 'regexp' ;
-/[a-b]/;
-/[a-\d]/;
-/[\d-b]/;
-/[\s-\d]/;
-/[\d-\s]/;
-/[a-[:digit:]]/;
-/[[:digit:]-b]/;
-/[[:alpha:]-[:digit:]]/;
-/[[:digit:]-[:alpha:]]/;
-EXPECT
-False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 12.
-False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 13.
-False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 14.
-False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 15.
-False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 16.
-False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 17.
-False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 18.
-False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 19.
-########
-# regcomp.c [S_regclass S_regclassutf8]
-use warnings 'regexp' ;
-$a =~ /[a\zb]/ ;
-no warnings 'regexp' ;
-$a =~ /[a\zb]/ ;
-EXPECT
-Unrecognized escape \z in character class passed through in regex; marked by <-- HERE in m/[a\z <-- HERE b]/ at - line 3.
-
-########
-# regcomp.c [S_reg]
-use warnings 'regexp' ;
-$a = qr/(?c)/;
-$a = qr/(?-c)/;
-$a = qr/(?g)/;
-$a = qr/(?-g)/;
-$a = qr/(?o)/;
-$a = qr/(?-o)/;
-$a = qr/(?g-o)/;
-$a = qr/(?g-c)/;
-$a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown
-$a = qr/(?ogc)/;
-no warnings 'regexp' ;
-$a = qr/(?c)/;
-$a = qr/(?-c)/;
-$a = qr/(?g)/;
-$a = qr/(?-g)/;
-$a = qr/(?o)/;
-$a = qr/(?-o)/;
-$a = qr/(?g-o)/;
-$a = qr/(?g-c)/;
-$a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown
-$a = qr/(?ogc)/;
-#EXPECT
-EXPECT
-Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?c <-- HERE )/ at - line 3.
-Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?-c <-- HERE )/ at - line 4.
-Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE )/ at - line 5.
-Useless (?-g) - don't use /g modifier in regex; marked by <-- HERE in m/(?-g <-- HERE )/ at - line 6.
-Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE )/ at - line 7.
-Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?-o <-- HERE )/ at - line 8.
-Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -o)/ at - line 9.
-Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?g-o <-- HERE )/ at - line 9.
-Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -c)/ at - line 10.
-Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?g-c <-- HERE )/ at - line 10.
-Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE -cg)/ at - line 11.
-Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?o-c <-- HERE g)/ at - line 11.
-Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE gc)/ at - line 12.
-Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?og <-- HERE c)/ at - line 12.
-Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?ogc <-- HERE )/ at - line 12.
-########
-# regcomp.c [S_regatom]
-$a = qr/\o{/;
-EXPECT
-Missing right brace on \o{ in regex; marked by <-- HERE in m/\o{ <-- HERE / at - line 2.
-########
-# regcomp.c [S_regatom]
-$a = qr/\o/;
-EXPECT
-Missing braces on \o{} in regex; marked by <-- HERE in m/\o <-- HERE / at - line 2.
-########
-# regcomp.c [S_regatom]
-$a = qr/\o{}/;
-EXPECT
-Number with no digits in regex; marked by <-- HERE in m/\o{} <-- HERE / at - line 2.
-########
-# regcomp.c [S_regclass]
-$a = qr/[\o{]/;
-EXPECT
-Missing right brace on \o{ in regex; marked by <-- HERE in m/[\o{ <-- HERE ]/ at - line 2.
-########
-# regcomp.c [S_regclass]
-$a = qr/[\o]/;
-EXPECT
-Missing braces on \o{} in regex; marked by <-- HERE in m/[\o <-- HERE ]/ at - line 2.
-########
-# regcomp.c [S_regclass]
-$a = qr/[\o{}]/;
-EXPECT
-Number with no digits in regex; marked by <-- HERE in m/[\o{} <-- HERE ]/ at - line 2.
-########
-# regcomp.c [S_regclass]
-use warnings 'regexp' ;
-$a = qr/[\8\9]/;
-$a = qr/[\_\0]/; # Should have no warnings on this and the remainder of this test
-$a = qr/[\07]/;
-$a = qr/[\006]/;
-$a = qr/[\0005]/;
-no warnings 'regexp' ;
-$a = qr/[\8\9]/;
-EXPECT
-Unrecognized escape \8 in character class passed through in regex; marked by <-- HERE in m/[\8 <-- HERE \9]/ at - line 3.
-Unrecognized escape \9 in character class passed through in regex; marked by <-- HERE in m/[\8\9 <-- HERE ]/ at - line 3.
-########
-# regcomp.c [Perl_re_compile]
-$a = qr/(?^-i:foo)/;
-EXPECT
-Sequence (?^-...) not recognized in regex; marked by <-- HERE in m/(?^- <-- HERE i:foo)/ at - line 2.
diff --git a/gnu/usr.bin/perl/t/lib/warnings/toke b/gnu/usr.bin/perl/t/lib/warnings/toke
index dd8dc3d517a..5ee3ad52109 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/toke
+++ b/gnu/usr.bin/perl/t/lib/warnings/toke
@@ -143,19 +143,39 @@ Use of comma-less variable list is deprecated at - line 4.
Use of comma-less variable list is deprecated at - line 4.
########
# toke.c
-$a =~ m/$foo/sand $bar;
-$a =~ s/$foo/fool/sand $bar;
$a = <<;
no warnings 'deprecated' ;
-$a =~ m/$foo/sand $bar;
-$a =~ s/$foo/fool/sand $bar;
$a = <<;
EXPECT
-Having no space between pattern and following word is deprecated at - line 2.
-Having no space between pattern and following word is deprecated at - line 3.
-Use of bare << to mean <<"" is deprecated at - line 4.
+Use of bare << to mean <<"" is deprecated at - line 2.
+########
+# toke.c
+$a =~ m/$foo/eq;
+$a =~ s/$foo/fool/seq;
+
+EXPECT
+OPTION fatal
+Unknown regexp modifier "/e" at - line 2, near "=~ "
+Unknown regexp modifier "/q" at - line 2, near "=~ "
+Unknown regexp modifier "/q" at - line 3, near "=~ "
+Execution of - aborted due to compilation errors.
+########
+# toke.c
+use utf8;
+use open qw( :utf8 :std );
+$a =~ m/$foo/eネq;
+$a =~ s/$foo/fool/seネq;
+
+EXPECT
+OPTION fatal
+Unknown regexp modifier "/e" at - line 4, near "=~ "
+Unknown regexp modifier "/ネ" at - line 4, near "=~ "
+Unknown regexp modifier "/q" at - line 4, near "=~ "
+Unknown regexp modifier "/ネ" at - line 5, near "=~ "
+Unknown regexp modifier "/q" at - line 5, near "=~ "
+Execution of - aborted due to compilation errors.
########
# toke.c
use warnings 'syntax' ;
@@ -662,6 +682,8 @@ yelp at foo line 30.
########
# toke.c
my $a = rand + 4 ;
+$a = rand *^H ;
+$a = rand $^H ;
EXPECT
Warning: Use of "rand" without parentheses is ambiguous at - line 2.
########
@@ -696,6 +718,8 @@ EXPECT
# toke.c
sub fred {};
-fred ;
+sub hank : lvalue {$_}
+--hank; # This should *not* warn [perl #77240]
EXPECT
Ambiguous use of -fred resolved as -&fred() at - line 3.
########
@@ -1063,7 +1087,7 @@ Number found where operator expected at (eval 1) line 1, near "5 6"
(Missing operator before 6?)
########
# toke.c
-use warnings "syntax";
+use warnings "syntax"; no warnings "deprecated";
$_ = $a = 1;
$a !=~ /1/;
$a !=~ m#1#;
@@ -1111,7 +1135,7 @@ Use of :locked is deprecated at - line 4.
Use of :locked is deprecated at - line 6.
########
# toke.c
-use warnings "syntax";
+use warnings "syntax"; use feature 'lexical_subs';
sub proto_after_array(@$);
sub proto_after_arref(\@$);
sub proto_after_arref2(\[@$]);
@@ -1123,6 +1147,14 @@ sub underscore_last_pos($_);
sub underscore2($_;$);
sub underscore_fail($_$);
sub underscore_after_at(@_);
+our sub hour (@$);
+my sub migh (@$);
+use feature 'state';
+state sub estate (@$);
+package other;
+sub hour (@$);
+sub migh (@$);
+sub estate (@$);
no warnings "syntax";
sub proto_after_array(@$);
sub proto_after_hash(%$);
@@ -1132,6 +1164,15 @@ Prototype after '@' for main::proto_after_array : @$ at - line 3.
Prototype after '%' for main::proto_after_hash : %$ at - line 7.
Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12.
Prototype after '@' for main::underscore_after_at : @_ at - line 13.
+The lexical_subs feature is experimental at - line 14.
+Prototype after '@' for hour : @$ at - line 14.
+The lexical_subs feature is experimental at - line 15.
+Prototype after '@' for migh : @$ at - line 15.
+The lexical_subs feature is experimental at - line 17.
+Prototype after '@' for estate : @$ at - line 17.
+Prototype after '@' for hour : @$ at - line 19.
+Prototype after '@' for migh : @$ at - line 20.
+Prototype after '@' for estate : @$ at - line 21.
########
# toke.c
use warnings "ambiguous";
@@ -1250,3 +1291,45 @@ use warnings;
CORE::렏;
EXPECT
CORE::렏 is not a keyword at - line 5.
+########
+# toke.c
+# [perl #16249]
+print '';
+eval this_method_is_fake ();
+EXPECT
+Undefined subroutine &main::this_method_is_fake called at - line 4.
+########
+# toke.c
+# [perl #107002] Erroneous ambiguity warnings
+sub { # do not actually call require
+ require a::b . 1; # These used to produce erroneous
+ require a::b + 1; # ambiguity warnings.
+}
+EXPECT
+########
+# toke.c
+# [perl #113094]
+print "aa" =~ m{^a\{1,2\}$}, "\n";
+print "aa" =~ m{^a\x\{61\}$}, "\n";
+print "aa" =~ m{^a{1,2}$}, "\n";
+print "aq" =~ m[^a\[a-z\]$], "\n";
+print "aq" =~ m(^a\(q\)$), "\n";
+no warnings 'deprecated';
+print "aa" =~ m{^a\{1,2\}$}, "\n";
+print "aa" =~ m{^a\x\{61\}$}, "\n";
+print "aq" =~ m[^a\[a-z\]$], "\n";
+print "aq" =~ m(^a\(q\)$), "\n";
+EXPECT
+Useless use of '\'; doesn't escape metacharacter '{' at - line 3.
+Useless use of '\'; doesn't escape metacharacter '{' at - line 4.
+Useless use of '\'; doesn't escape metacharacter '[' at - line 6.
+Useless use of '\'; doesn't escape metacharacter '(' at - line 7.
+1
+1
+1
+1
+q
+1
+1
+1
+q
diff --git a/gnu/usr.bin/perl/t/lib/warnings/utf8 b/gnu/usr.bin/perl/t/lib/warnings/utf8
index 603cfa0faf4..1274cf9f2f7 100644
--- a/gnu/usr.bin/perl/t/lib/warnings/utf8
+++ b/gnu/usr.bin/perl/t/lib/warnings/utf8
@@ -170,7 +170,283 @@ chr(0x10000) =~ /\p{Any}/;
chr(0x100000) =~ /\p{Any}/;
chr(0x10FFFE) =~ /\p{Any}/;
chr(0x10FFFF) =~ /\p{Any}/;
-chr(0x110000) =~ /\p{Any}/;
+chr(0x110000) =~ /[\w\p{Any}]/;
+chr(0x110010) =~ /[\w\p{PosixWord}]/;
+chr(0x110011) =~ /[\w\P{PosixWord}]/;
+chr(0x110012) =~ /[\w\p{XPosixWord}]/;
+chr(0x110013) =~ /[\w\P{XPosixWord}]/;
+chr(0x110014) =~ /[\w\p{PosixAlnum}]/;
+chr(0x110015) =~ /[\w\P{PosixAlnum}]/;
+chr(0x110016) =~ /[\w\p{XPosixAlnum}]/;
+chr(0x110017) =~ /[\w\P{XPosixAlnum}]/;
+chr(0x110018) =~ /[\w\p{PosixSpace}]/;
+chr(0x110019) =~ /[\w\P{PosixSpace}]/;
+chr(0x11001A) =~ /[\w\p{XPosixSpace}]/;
+chr(0x11001B) =~ /[\w\P{XPosixSpace}]/;
+chr(0x11001C) =~ /[\w\p{PosixDigit}]/;
+chr(0x11001D) =~ /[\w\P{PosixDigit}]/;
+chr(0x11001E) =~ /[\w\p{XPosixDigit}]/;
+chr(0x11001F) =~ /[\w\P{XPosixDigit}]/;
+chr(0x110020) =~ /[\w\p{PosixAlpha}]/;
+chr(0x110021) =~ /[\w\P{PosixAlpha}]/;
+chr(0x110022) =~ /[\w\p{XPosixAlpha}]/;
+chr(0x110023) =~ /[\w\P{XPosixAlpha}]/;
+chr(0x110024) =~ /[\w\p{Ascii}]/;
+chr(0x110025) =~ /[\w\P{Ascii}]/;
+chr(0x110026) =~ /[\w\p{PosixCntrl}]/;
+chr(0x110027) =~ /[\w\P{PosixCntrl}]/;
+chr(0x110028) =~ /[\w\p{XPosixCntrl}]/;
+chr(0x110029) =~ /[\w\P{XPosixCntrl}]/;
+chr(0x11002A) =~ /[\w\p{PosixGraph}]/;
+chr(0x11002B) =~ /[\w\P{PosixGraph}]/;
+chr(0x11002C) =~ /[\w\p{XPosixGraph}]/;
+chr(0x11002D) =~ /[\w\P{XPosixGraph}]/;
+chr(0x11002E) =~ /[\w\p{PosixLower}]/;
+chr(0x11002F) =~ /[\w\P{PosixLower}]/;
+chr(0x110030) =~ /[\w\p{XPosixLower}]/;
+chr(0x110031) =~ /[\w\P{XPosixLower}]/;
+chr(0x110032) =~ /[\w\p{PosixPrint}]/;
+chr(0x110033) =~ /[\w\P{PosixPrint}]/;
+chr(0x110034) =~ /[\w\p{XPosixPrint}]/;
+chr(0x110035) =~ /[\w\P{XPosixPrint}]/;
+chr(0x110036) =~ /[\w\p{PosixPunct}]/;
+chr(0x110037) =~ /[\w\P{PosixPunct}]/;
+chr(0x110038) =~ /[\w\p{XPosixPunct}]/;
+chr(0x110039) =~ /[\w\P{XPosixPunct}]/;
+chr(0x11003A) =~ /[\w\p{PosixUpper}]/;
+chr(0x11003B) =~ /[\w\P{PosixUpper}]/;
+chr(0x11003C) =~ /[\w\p{XPosixUpper}]/;
+chr(0x11003D) =~ /[\w\P{XPosixUpper}]/;
+chr(0x11003E) =~ /[\w\p{PosixXdigit}]/;
+chr(0x11003F) =~ /[\w\P{PosixXdigit}]/;
+chr(0x110040) =~ /[\w\p{XPosixXdigit}]/;
+chr(0x110041) =~ /[\w\P{XPosixXdigit}]/;
+chr(0x110042) =~ /[\w\p{PerlSpace}]/;
+chr(0x110043) =~ /[\w\P{PerlSpace}]/;
+chr(0x110044) =~ /[\w\p{XPerlSpace}]/;
+chr(0x110045) =~ /[\w\P{XPerlSpace}]/;
+chr(0x110046) =~ /[\w\p{PosixBlank}]/;
+chr(0x110047) =~ /[\w\P{PosixBlank}]/;
+chr(0x110048) =~ /[\w\p{XPosixBlank}]/;
+chr(0x110049) =~ /[\w\P{XPosixBlank}]/;
+# Currently some warnings from the above are output twice
+# Only Unicode properties give non-Unicode warnings, and not when something
+# else in the class matches above Unicode. Below we test three ways where
+# something outside the property may match non-Unicode: a code point above it,
+# a class \S that we know at compile time doesn't, and a class \W whose values
+# aren't (at the time of this writing) specified at compile time, but which
+# wouldn't match
+chr(0x110050) =~ /\w/;
+chr(0x110051) =~ /\W/;
+chr(0x110052) =~ /\d/;
+chr(0x110053) =~ /\D/;
+chr(0x110054) =~ /\s/;
+chr(0x110055) =~ /\S/;
+chr(0x110056) =~ /[[:word:]]/;
+chr(0x110057) =~ /[[:^word:]]/;
+chr(0x110058) =~ /[[:alnum:]]/;
+chr(0x110059) =~ /[[:^alnum:]]/;
+chr(0x11005A) =~ /[[:space:]]/;
+chr(0x11005B) =~ /[[:^space:]]/;
+chr(0x11005C) =~ /[[:digit:]]/;
+chr(0x11005D) =~ /[[:^digit:]]/;
+chr(0x11005E) =~ /[[:alpha:]]/;
+chr(0x11005F) =~ /[[:^alpha:]]/;
+chr(0x110060) =~ /[[:ascii:]]/;
+chr(0x110061) =~ /[[:^ascii:]]/;
+chr(0x110062) =~ /[[:cntrl:]]/;
+chr(0x110063) =~ /[[:^cntrl:]]/;
+chr(0x110064) =~ /[[:graph:]]/;
+chr(0x110065) =~ /[[:^graph:]]/;
+chr(0x110066) =~ /[[:lower:]]/;
+chr(0x110067) =~ /[[:^lower:]]/;
+chr(0x110068) =~ /[[:print:]]/;
+chr(0x110069) =~ /[[:^print:]]/;
+chr(0x11006A) =~ /[[:punct:]]/;
+chr(0x11006B) =~ /[[:^punct:]]/;
+chr(0x11006C) =~ /[[:upper:]]/;
+chr(0x11006D) =~ /[[:^upper:]]/;
+chr(0x11006E) =~ /[[:xdigit:]]/;
+chr(0x11006F) =~ /[[:^xdigit:]]/;
+chr(0x110070) =~ /[[:blank:]]/;
+chr(0x110071) =~ /[[:^blank:]]/;
+chr(0x111000) =~ /[\W\p{Any}]/;
+chr(0x111010) =~ /[\W\p{PosixWord}]/;
+chr(0x111011) =~ /[\W\P{PosixWord}]/;
+chr(0x111012) =~ /[\W\p{XPosixWord}]/;
+chr(0x111013) =~ /[\W\P{XPosixWord}]/;
+chr(0x111014) =~ /[\W\p{PosixAlnum}]/;
+chr(0x111015) =~ /[\W\P{PosixAlnum}]/;
+chr(0x111016) =~ /[\W\p{XPosixAlnum}]/;
+chr(0x111017) =~ /[\W\P{XPosixAlnum}]/;
+chr(0x111018) =~ /[\W\p{PosixSpace}]/;
+chr(0x111019) =~ /[\W\P{PosixSpace}]/;
+chr(0x11101A) =~ /[\W\p{XPosixSpace}]/;
+chr(0x11101B) =~ /[\W\P{XPosixSpace}]/;
+chr(0x11101C) =~ /[\W\p{PosixDigit}]/;
+chr(0x11101D) =~ /[\W\P{PosixDigit}]/;
+chr(0x11101E) =~ /[\W\p{XPosixDigit}]/;
+chr(0x11101F) =~ /[\W\P{XPosixDigit}]/;
+chr(0x111020) =~ /[\W\p{PosixAlpha}]/;
+chr(0x111021) =~ /[\W\P{PosixAlpha}]/;
+chr(0x111022) =~ /[\W\p{XPosixAlpha}]/;
+chr(0x111023) =~ /[\W\P{XPosixAlpha}]/;
+chr(0x111024) =~ /[\W\p{Ascii}]/;
+chr(0x111025) =~ /[\W\P{Ascii}]/;
+chr(0x111026) =~ /[\W\p{PosixCntrl}]/;
+chr(0x111027) =~ /[\W\P{PosixCntrl}]/;
+chr(0x111028) =~ /[\W\p{XPosixCntrl}]/;
+chr(0x111029) =~ /[\W\P{XPosixCntrl}]/;
+chr(0x11102A) =~ /[\W\p{PosixGraph}]/;
+chr(0x11102B) =~ /[\W\P{PosixGraph}]/;
+chr(0x11102C) =~ /[\W\p{XPosixGraph}]/;
+chr(0x11102D) =~ /[\W\P{XPosixGraph}]/;
+chr(0x11102E) =~ /[\W\p{PosixLower}]/;
+chr(0x11102F) =~ /[\W\P{PosixLower}]/;
+chr(0x111030) =~ /[\W\p{XPosixLower}]/;
+chr(0x111031) =~ /[\W\P{XPosixLower}]/;
+chr(0x111032) =~ /[\W\p{PosixPrint}]/;
+chr(0x111033) =~ /[\W\P{PosixPrint}]/;
+chr(0x111034) =~ /[\W\p{XPosixPrint}]/;
+chr(0x111035) =~ /[\W\P{XPosixPrint}]/;
+chr(0x111036) =~ /[\W\p{PosixPunct}]/;
+chr(0x111037) =~ /[\W\P{PosixPunct}]/;
+chr(0x111038) =~ /[\W\p{XPosixPunct}]/;
+chr(0x111039) =~ /[\W\P{XPosixPunct}]/;
+chr(0x11103A) =~ /[\W\p{PosixUpper}]/;
+chr(0x11103B) =~ /[\W\P{PosixUpper}]/;
+chr(0x11103C) =~ /[\W\p{XPosixUpper}]/;
+chr(0x11103D) =~ /[\W\P{XPosixUpper}]/;
+chr(0x11103E) =~ /[\W\p{PosixXdigit}]/;
+chr(0x11103F) =~ /[\W\P{PosixXdigit}]/;
+chr(0x111040) =~ /[\W\p{XPosixXdigit}]/;
+chr(0x111041) =~ /[\W\P{XPosixXdigit}]/;
+chr(0x111042) =~ /[\W\p{PerlSpace}]/;
+chr(0x111043) =~ /[\W\P{PerlSpace}]/;
+chr(0x111044) =~ /[\W\p{XPerlSpace}]/;
+chr(0x111045) =~ /[\W\P{XPerlSpace}]/;
+chr(0x111046) =~ /[\W\p{PosixBlank}]/;
+chr(0x111047) =~ /[\W\P{PosixBlank}]/;
+chr(0x111048) =~ /[\W\p{XPosixBlank}]/;
+chr(0x111049) =~ /[\W\P{XPosixBlank}]/;
+chr(0x112000) =~ /[\S\p{Any}]/;
+chr(0x112010) =~ /[\S\p{PosixWord}]/;
+chr(0x112011) =~ /[\S\P{PosixWord}]/;
+chr(0x112012) =~ /[\S\p{XPosixWord}]/;
+chr(0x112013) =~ /[\S\P{XPosixWord}]/;
+chr(0x112014) =~ /[\S\p{PosixAlnum}]/;
+chr(0x112015) =~ /[\S\P{PosixAlnum}]/;
+chr(0x112016) =~ /[\S\p{XPosixAlnum}]/;
+chr(0x112017) =~ /[\S\P{XPosixAlnum}]/;
+chr(0x112018) =~ /[\S\p{PosixSpace}]/;
+chr(0x112019) =~ /[\S\P{PosixSpace}]/;
+chr(0x11201A) =~ /[\S\p{XPosixSpace}]/;
+chr(0x11201B) =~ /[\S\P{XPosixSpace}]/;
+chr(0x11201C) =~ /[\S\p{PosixDigit}]/;
+chr(0x11201D) =~ /[\S\P{PosixDigit}]/;
+chr(0x11201E) =~ /[\S\p{XPosixDigit}]/;
+chr(0x11201F) =~ /[\S\P{XPosixDigit}]/;
+chr(0x112020) =~ /[\S\p{PosixAlpha}]/;
+chr(0x112021) =~ /[\S\P{PosixAlpha}]/;
+chr(0x112022) =~ /[\S\p{XPosixAlpha}]/;
+chr(0x112023) =~ /[\S\P{XPosixAlpha}]/;
+chr(0x112024) =~ /[\S\p{Ascii}]/;
+chr(0x112025) =~ /[\S\P{Ascii}]/;
+chr(0x112026) =~ /[\S\p{PosixCntrl}]/;
+chr(0x112027) =~ /[\S\P{PosixCntrl}]/;
+chr(0x112028) =~ /[\S\p{XPosixCntrl}]/;
+chr(0x112029) =~ /[\S\P{XPosixCntrl}]/;
+chr(0x11202A) =~ /[\S\p{PosixGraph}]/;
+chr(0x11202B) =~ /[\S\P{PosixGraph}]/;
+chr(0x11202C) =~ /[\S\p{XPosixGraph}]/;
+chr(0x11202D) =~ /[\S\P{XPosixGraph}]/;
+chr(0x11202E) =~ /[\S\p{PosixLower}]/;
+chr(0x11202F) =~ /[\S\P{PosixLower}]/;
+chr(0x112030) =~ /[\S\p{XPosixLower}]/;
+chr(0x112031) =~ /[\S\P{XPosixLower}]/;
+chr(0x112032) =~ /[\S\p{PosixPrint}]/;
+chr(0x112033) =~ /[\S\P{PosixPrint}]/;
+chr(0x112034) =~ /[\S\p{XPosixPrint}]/;
+chr(0x112035) =~ /[\S\P{XPosixPrint}]/;
+chr(0x112036) =~ /[\S\p{PosixPunct}]/;
+chr(0x112037) =~ /[\S\P{PosixPunct}]/;
+chr(0x112038) =~ /[\S\p{XPosixPunct}]/;
+chr(0x112039) =~ /[\S\P{XPosixPunct}]/;
+chr(0x11203A) =~ /[\S\p{PosixUpper}]/;
+chr(0x11203B) =~ /[\S\P{PosixUpper}]/;
+chr(0x11203C) =~ /[\S\p{XPosixUpper}]/;
+chr(0x11203D) =~ /[\S\P{XPosixUpper}]/;
+chr(0x11203E) =~ /[\S\p{PosixXdigit}]/;
+chr(0x11203F) =~ /[\S\P{PosixXdigit}]/;
+chr(0x112040) =~ /[\S\p{XPosixXdigit}]/;
+chr(0x112041) =~ /[\S\P{XPosixXdigit}]/;
+chr(0x112042) =~ /[\S\p{PerlSpace}]/;
+chr(0x112043) =~ /[\S\P{PerlSpace}]/;
+chr(0x112044) =~ /[\S\p{XPerlSpace}]/;
+chr(0x112045) =~ /[\S\P{XPerlSpace}]/;
+chr(0x112046) =~ /[\S\p{PosixBlank}]/;
+chr(0x112047) =~ /[\S\P{PosixBlank}]/;
+chr(0x112048) =~ /[\S\p{XPosixBlank}]/;
+chr(0x112049) =~ /[\S\P{XPosixBlank}]/;
+chr(0x113000) =~ /[\x{110000}\p{Any}]/;
+chr(0x113010) =~ /[\x{110000}\p{PosixWord}]/;
+chr(0x113011) =~ /[\x{110000}\P{PosixWord}]/;
+chr(0x113012) =~ /[\x{110000}\p{XPosixWord}]/;
+chr(0x113013) =~ /[\x{110000}\P{XPosixWord}]/;
+chr(0x113014) =~ /[\x{110000}\p{PosixAlnum}]/;
+chr(0x113015) =~ /[\x{110000}\P{PosixAlnum}]/;
+chr(0x113016) =~ /[\x{110000}\p{XPosixAlnum}]/;
+chr(0x113017) =~ /[\x{110000}\P{XPosixAlnum}]/;
+chr(0x113018) =~ /[\x{110000}\p{PosixSpace}]/;
+chr(0x113019) =~ /[\x{110000}\P{PosixSpace}]/;
+chr(0x11301A) =~ /[\x{110000}\p{XPosixSpace}]/;
+chr(0x11301B) =~ /[\x{110000}\P{XPosixSpace}]/;
+chr(0x11301C) =~ /[\x{110000}\p{PosixDigit}]/;
+chr(0x11301D) =~ /[\x{110000}\P{PosixDigit}]/;
+chr(0x11301E) =~ /[\x{110000}\p{XPosixDigit}]/;
+chr(0x11301F) =~ /[\x{110000}\P{XPosixDigit}]/;
+chr(0x113020) =~ /[\x{110000}\p{PosixAlpha}]/;
+chr(0x113021) =~ /[\x{110000}\P{PosixAlpha}]/;
+chr(0x113022) =~ /[\x{110000}\p{XPosixAlpha}]/;
+chr(0x113023) =~ /[\x{110000}\P{XPosixAlpha}]/;
+chr(0x113024) =~ /[\x{110000}\p{Ascii}]/;
+chr(0x113025) =~ /[\x{110000}\P{Ascii}]/;
+chr(0x113026) =~ /[\x{110000}\p{PosixCntrl}]/;
+chr(0x113027) =~ /[\x{110000}\P{PosixCntrl}]/;
+chr(0x113028) =~ /[\x{110000}\p{XPosixCntrl}]/;
+chr(0x113029) =~ /[\x{110000}\P{XPosixCntrl}]/;
+chr(0x11302A) =~ /[\x{110000}\p{PosixGraph}]/;
+chr(0x11302B) =~ /[\x{110000}\P{PosixGraph}]/;
+chr(0x11302C) =~ /[\x{110000}\p{XPosixGraph}]/;
+chr(0x11302D) =~ /[\x{110000}\P{XPosixGraph}]/;
+chr(0x11302E) =~ /[\x{110000}\p{PosixLower}]/;
+chr(0x11302F) =~ /[\x{110000}\P{PosixLower}]/;
+chr(0x113030) =~ /[\x{110000}\p{XPosixLower}]/;
+chr(0x113031) =~ /[\x{110000}\P{XPosixLower}]/;
+chr(0x113032) =~ /[\x{110000}\p{PosixPrint}]/;
+chr(0x113033) =~ /[\x{110000}\P{PosixPrint}]/;
+chr(0x113034) =~ /[\x{110000}\p{XPosixPrint}]/;
+chr(0x113035) =~ /[\x{110000}\P{XPosixPrint}]/;
+chr(0x113036) =~ /[\x{110000}\p{PosixPunct}]/;
+chr(0x113037) =~ /[\x{110000}\P{PosixPunct}]/;
+chr(0x113038) =~ /[\x{110000}\p{XPosixPunct}]/;
+chr(0x113039) =~ /[\x{110000}\P{XPosixPunct}]/;
+chr(0x11303A) =~ /[\x{110000}\p{PosixUpper}]/;
+chr(0x11303B) =~ /[\x{110000}\P{PosixUpper}]/;
+chr(0x11303C) =~ /[\x{110000}\p{XPosixUpper}]/;
+chr(0x11303D) =~ /[\x{110000}\P{XPosixUpper}]/;
+chr(0x11303E) =~ /[\x{110000}\p{PosixXdigit}]/;
+chr(0x11303F) =~ /[\x{110000}\P{PosixXdigit}]/;
+chr(0x113040) =~ /[\x{110000}\p{XPosixXdigit}]/;
+chr(0x113041) =~ /[\x{110000}\P{XPosixXdigit}]/;
+chr(0x113042) =~ /[\x{110000}\p{PerlSpace}]/;
+chr(0x113043) =~ /[\x{110000}\P{PerlSpace}]/;
+chr(0x113044) =~ /[\x{110000}\p{XPerlSpace}]/;
+chr(0x113045) =~ /[\x{110000}\P{XPerlSpace}]/;
+chr(0x113046) =~ /[\x{110000}\p{PosixBlank}]/;
+chr(0x113047) =~ /[\x{110000}\P{PosixBlank}]/;
+chr(0x113048) =~ /[\x{110000}\p{XPosixBlank}]/;
+chr(0x113049) =~ /[\x{110000}\P{XPosixBlank}]/;
no warnings 'utf8';
chr(0xD7FF) =~ /\p{Any}/;
chr(0xD800) =~ /\p{Any}/;
@@ -185,8 +461,187 @@ chr(0x100000) =~ /\p{Any}/;
chr(0x10FFFE) =~ /\p{Any}/;
chr(0x10FFFF) =~ /\p{Any}/;
chr(0x110000) =~ /\p{Any}/;
+chr(0x110010) =~ /\p{PosixWord}/;
+chr(0x110011) =~ /\P{PosixWord}/;
+chr(0x110012) =~ /\p{XPosixWord}/;
+chr(0x110013) =~ /\P{XPosixWord}/;
+chr(0x110014) =~ /\p{PosixAlnum}/;
+chr(0x110015) =~ /\P{PosixAlnum}/;
+chr(0x110016) =~ /\p{XPosixAlnum}/;
+chr(0x110017) =~ /\P{XPosixAlnum}/;
+chr(0x110018) =~ /\p{PosixSpace}/;
+chr(0x110019) =~ /\P{PosixSpace}/;
+chr(0x11001A) =~ /\p{XPosixSpace}/;
+chr(0x11001B) =~ /\P{XPosixSpace}/;
+chr(0x11001C) =~ /\p{PosixDigit}/;
+chr(0x11001D) =~ /\P{PosixDigit}/;
+chr(0x11001E) =~ /\p{XPosixDigit}/;
+chr(0x11001F) =~ /\P{XPosixDigit}/;
+chr(0x110020) =~ /\p{PosixAlpha}/;
+chr(0x110021) =~ /\P{PosixAlpha}/;
+chr(0x110022) =~ /\p{XPosixAlpha}/;
+chr(0x110023) =~ /\P{XPosixAlpha}/;
+chr(0x110024) =~ /\p{Ascii}/;
+chr(0x110025) =~ /\P{Ascii}/;
+chr(0x110026) =~ /\p{PosixCntrl}/;
+chr(0x110027) =~ /\P{PosixCntrl}/;
+chr(0x110028) =~ /\p{XPosixCntrl}/;
+chr(0x110029) =~ /\P{XPosixCntrl}/;
+chr(0x11002A) =~ /\p{PosixGraph}/;
+chr(0x11002B) =~ /\P{PosixGraph}/;
+chr(0x11002C) =~ /\p{XPosixGraph}/;
+chr(0x11002D) =~ /\P{XPosixGraph}/;
+chr(0x11002E) =~ /\p{PosixLower}/;
+chr(0x11002F) =~ /\P{PosixLower}/;
+chr(0x110030) =~ /\p{XPosixLower}/;
+chr(0x110031) =~ /\P{XPosixLower}/;
+chr(0x110032) =~ /\p{PosixPrint}/;
+chr(0x110033) =~ /\P{PosixPrint}/;
+chr(0x110034) =~ /\p{XPosixPrint}/;
+chr(0x110035) =~ /\P{XPosixPrint}/;
+chr(0x110036) =~ /\p{PosixPunct}/;
+chr(0x110037) =~ /\P{PosixPunct}/;
+chr(0x110038) =~ /\p{XPosixPunct}/;
+chr(0x110039) =~ /\P{XPosixPunct}/;
+chr(0x11003A) =~ /\p{PosixUpper}/;
+chr(0x11003B) =~ /\P{PosixUpper}/;
+chr(0x11003C) =~ /\p{XPosixUpper}/;
+chr(0x11003D) =~ /\P{XPosixUpper}/;
+chr(0x11003E) =~ /\p{PosixXdigit}/;
+chr(0x11003F) =~ /\P{PosixXdigit}/;
+chr(0x110040) =~ /\p{XPosixXdigit}/;
+chr(0x110041) =~ /\P{XPosixXdigit}/;
+chr(0x110042) =~ /\p{PerlSpace}/;
+chr(0x110043) =~ /\P{PerlSpace}/;
+chr(0x110044) =~ /\p{XPerlSpace}/;
+chr(0x110045) =~ /\P{XPerlSpace}/;
+chr(0x110046) =~ /\p{PosixBlank}/;
+chr(0x110047) =~ /\P{PosixBlank}/;
+chr(0x110048) =~ /\p{XPosixBlank}/;
+chr(0x110049) =~ /\P{XPosixBlank}/;
+chr(0x110050) =~ /\w/;
+chr(0x110051) =~ /\W/;
+chr(0x110052) =~ /\d/;
+chr(0x110053) =~ /\D/;
+chr(0x110054) =~ /\s/;
+chr(0x110055) =~ /\S/;
+chr(0x110056) =~ /[[:word:]]/;
+chr(0x110057) =~ /[[:^word:]]/;
+chr(0x110058) =~ /[[:alnum:]]/;
+chr(0x110059) =~ /[[:^alnum:]]/;
+chr(0x11005A) =~ /[[:space:]]/;
+chr(0x11005B) =~ /[[:^space:]]/;
+chr(0x11005C) =~ /[[:digit:]]/;
+chr(0x11005D) =~ /[[:^digit:]]/;
+chr(0x11005E) =~ /[[:alpha:]]/;
+chr(0x11005F) =~ /[[:^alpha:]]/;
+chr(0x110060) =~ /[[:ascii:]]/;
+chr(0x110061) =~ /[[:^ascii:]]/;
+chr(0x110062) =~ /[[:cntrl:]]/;
+chr(0x110063) =~ /[[:^cntrl:]]/;
+chr(0x110064) =~ /[[:graph:]]/;
+chr(0x110065) =~ /[[:^graph:]]/;
+chr(0x110066) =~ /[[:lower:]]/;
+chr(0x110067) =~ /[[:^lower:]]/;
+chr(0x110068) =~ /[[:print:]]/;
+chr(0x110069) =~ /[[:^print:]]/;
+chr(0x11006A) =~ /[[:punct:]]/;
+chr(0x11006B) =~ /[[:^punct:]]/;
+chr(0x11006C) =~ /[[:upper:]]/;
+chr(0x11006D) =~ /[[:^upper:]]/;
+chr(0x11006E) =~ /[[:xdigit:]]/;
+chr(0x11006F) =~ /[[:^xdigit:]]/;
+chr(0x110070) =~ /[[:blank:]]/;
+chr(0x110071) =~ /[[:^blank:]]/;
EXPECT
Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 14.
+Code point 0x110010 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 15.
+Code point 0x110011 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 16.
+Code point 0x110011 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 16.
+Code point 0x110012 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 17.
+Code point 0x110013 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 18.
+Code point 0x110013 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 18.
+Code point 0x110014 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 19.
+Code point 0x110015 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 20.
+Code point 0x110015 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 20.
+Code point 0x110016 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 21.
+Code point 0x110017 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 22.
+Code point 0x110017 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 22.
+Code point 0x110018 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 23.
+Code point 0x110019 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 24.
+Code point 0x110019 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 24.
+Code point 0x11001A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 25.
+Code point 0x11001B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 26.
+Code point 0x11001B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 26.
+Code point 0x11001C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 27.
+Code point 0x11001D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 28.
+Code point 0x11001D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 28.
+Code point 0x11001E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 29.
+Code point 0x11001F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 30.
+Code point 0x11001F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 30.
+Code point 0x110020 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 31.
+Code point 0x110021 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 32.
+Code point 0x110021 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 32.
+Code point 0x110022 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 33.
+Code point 0x110023 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 34.
+Code point 0x110023 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 34.
+Code point 0x110024 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 35.
+Code point 0x110025 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 36.
+Code point 0x110025 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 36.
+Code point 0x110026 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 37.
+Code point 0x110027 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 38.
+Code point 0x110027 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 38.
+Code point 0x110028 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 39.
+Code point 0x110029 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 40.
+Code point 0x110029 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 40.
+Code point 0x11002A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 41.
+Code point 0x11002B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 42.
+Code point 0x11002B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 42.
+Code point 0x11002C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 43.
+Code point 0x11002D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 44.
+Code point 0x11002D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 44.
+Code point 0x11002E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 45.
+Code point 0x11002F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 46.
+Code point 0x11002F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 46.
+Code point 0x110030 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 47.
+Code point 0x110031 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 48.
+Code point 0x110031 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 48.
+Code point 0x110032 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 49.
+Code point 0x110033 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 50.
+Code point 0x110033 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 50.
+Code point 0x110034 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 51.
+Code point 0x110035 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 52.
+Code point 0x110035 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 52.
+Code point 0x110036 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 53.
+Code point 0x110037 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 54.
+Code point 0x110037 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 54.
+Code point 0x110038 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 55.
+Code point 0x110039 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 56.
+Code point 0x110039 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 56.
+Code point 0x11003A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 57.
+Code point 0x11003B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 58.
+Code point 0x11003B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 58.
+Code point 0x11003C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 59.
+Code point 0x11003D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 60.
+Code point 0x11003D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 60.
+Code point 0x11003E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 61.
+Code point 0x11003F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 62.
+Code point 0x11003F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 62.
+Code point 0x110040 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 63.
+Code point 0x110041 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 64.
+Code point 0x110041 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 64.
+Code point 0x110042 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 65.
+Code point 0x110043 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 66.
+Code point 0x110043 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 66.
+Code point 0x110044 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 67.
+Code point 0x110045 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 68.
+Code point 0x110045 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 68.
+Code point 0x110046 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 69.
+Code point 0x110047 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 70.
+Code point 0x110047 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 70.
+Code point 0x110048 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 71.
+Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72.
+Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72.
########
use warnings 'utf8';
chr(0x110000) =~ /\p{Any}/;
@@ -195,6 +650,14 @@ chr(0x110000) =~ /\p{Any}/;
EXPECT
Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2.
########
+# TODO optimized regnode should still give warnings
+use warnings 'utf8';
+chr(0x110000) =~ /lb=cr/;
+no warnings 'non_unicode';
+chr(0x110000) =~ /lb=cr/;
+EXPECT
+Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2.
+########
require "../test.pl";
use warnings 'utf8';
sub Is_Super { return '!utf8::Any' }