diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 1237915d8631..c9754cd3f576 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -887,7 +887,6 @@ my $f = sub { } ; #### # anonconst -# CONTEXT no warnings 'experimental::const_attr'; my $f = sub : const { 123; } diff --git a/lib/warnings.pm b/lib/warnings.pm index 3d90a95ed495..42eea7473579 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -85,58 +85,57 @@ our %Offsets = ( 'syscalls' => 110, # Warnings Categories added in Perl 5.021 - 'experimental::const_attr' => 112, - 'experimental::re_strict' => 114, - 'experimental::refaliasing' => 116, - 'locale' => 118, - 'missing' => 120, - 'redundant' => 122, + 'experimental::re_strict' => 112, + 'experimental::refaliasing' => 114, + 'locale' => 116, + 'missing' => 118, + 'redundant' => 120, # Warnings Categories added in Perl 5.025 - 'experimental::declared_refs' => 124, + 'experimental::declared_refs' => 122, # Warnings Categories added in Perl 5.025011 - 'deprecated::dot_in_inc' => 126, + 'deprecated::dot_in_inc' => 124, # Warnings Categories added in Perl 5.027 - 'shadow' => 128, + 'shadow' => 126, # Warnings Categories added in Perl 5.029 - 'experimental::private_use' => 130, - 'experimental::uniprop_wildcards' => 132, - 'experimental::vlb' => 134, + 'experimental::private_use' => 128, + 'experimental::uniprop_wildcards' => 130, + 'experimental::vlb' => 132, # Warnings Categories added in Perl 5.033 - 'experimental::try' => 136, + 'experimental::try' => 134, # Warnings Categories added in Perl 5.035 - 'experimental::args_array_with_signatures'=> 138, - 'experimental::builtin' => 140, - 'experimental::defer' => 142, - 'experimental::extra_paired_delimiters'=> 144, - 'experimental::for_list' => 146, - 'scalar' => 148, + 'experimental::args_array_with_signatures'=> 136, + 'experimental::builtin' => 138, + 'experimental::defer' => 140, + 'experimental::extra_paired_delimiters'=> 142, + 'experimental::for_list' => 144, + 'scalar' => 146, # Warnings Categories added in Perl 5.035009 - 'deprecated::version_downgrade' => 150, + 'deprecated::version_downgrade' => 148, # Warnings Categories added in Perl 5.03501 - 'deprecated::delimiter_will_be_paired'=> 152, + 'deprecated::delimiter_will_be_paired'=> 150, # Warnings Categories added in Perl 5.037 - 'experimental::class' => 154, + 'experimental::class' => 152, # Warnings Categories added in Perl 5.037009 - 'deprecated::apostrophe_as_package_separator'=> 156, + 'deprecated::apostrophe_as_package_separator'=> 154, # Warnings Categories added in Perl 5.03701 - 'deprecated::smartmatch' => 158, + 'deprecated::smartmatch' => 156, # Warnings Categories added in Perl 5.039002 - 'deprecated::missing_import_called_with_args'=> 160, + 'deprecated::missing_import_called_with_args'=> 158, # Warnings Categories added in Perl 5.039008 - 'deprecated::subsequent_use_version'=> 162, + 'deprecated::subsequent_use_version'=> 160, ); our %Bits = ( @@ -146,35 +145,34 @@ our %Bits = ( 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] - 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x40\x00\x00\x40\x51\x05", # [2,48,49,63,75,76,78..81] - 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [78] - 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [76] - 'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [63] + 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x10\x00\x00\x50\x54\x01", # [2,48,49,62,74,75,77..80] + 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [77] + 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [75] + 'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [62] 'deprecated::goto_construct' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [48] - 'deprecated::missing_import_called_with_args'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [80] - 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [79] - 'deprecated::subsequent_use_version'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [81] + 'deprecated::missing_import_called_with_args'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [79] + 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [78] + 'deprecated::subsequent_use_version'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [80] 'deprecated::unicode_property_name' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [49] - 'deprecated::version_downgrade' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [75] + 'deprecated::version_downgrade' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [74] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x15\x10\x54\x55\x05\x04\x00", # [53,54,56..58,62,65..73,77] - 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [69] - 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [70] - 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [77] - 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [56] - 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [62] - 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [71] - 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [72] - 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [73] - 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [65] - 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [57] - 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [58] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x05\x04\x55\x55\x01\x01\x00", # [53,54,56,57,61,64..72,76] + 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [68] + 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [69] + 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [76] + 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [61] + 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [70] + 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [71] + 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [72] + 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [64] + 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [56] + 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [57] 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [54] - 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [68] - 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [66] - 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [67] + 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [67] + 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [65] + 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [66] 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [46] @@ -182,10 +180,10 @@ our %Bits = ( 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [5..11,55] 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] - 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [59] + 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [58] 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] - 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [60] + 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [59] 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [50] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [51] @@ -202,13 +200,13 @@ our %Bits = ( 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] - 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [61] + 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [60] 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] - 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [74] + 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [73] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] - 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [64] + 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [63] 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [52] @@ -231,35 +229,34 @@ our %DeadBits = ( 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] - 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x80\x00\x00\x80\xa2\x0a", # [2,48,49,63,75,76,78..81] - 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [78] - 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [76] - 'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [63] + 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x20\x00\x00\xa0\xa8\x02", # [2,48,49,62,74,75,77..80] + 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [77] + 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [75] + 'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [62] 'deprecated::goto_construct' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [48] - 'deprecated::missing_import_called_with_args'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [80] - 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [79] - 'deprecated::subsequent_use_version'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [81] + 'deprecated::missing_import_called_with_args'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [79] + 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [78] + 'deprecated::subsequent_use_version'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [80] 'deprecated::unicode_property_name' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [49] - 'deprecated::version_downgrade' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [75] + 'deprecated::version_downgrade' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [74] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x2a\x20\xa8\xaa\x0a\x08\x00", # [53,54,56..58,62,65..73,77] - 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [69] - 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [70] - 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [77] - 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [56] - 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [62] - 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [71] - 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [72] - 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [73] - 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [65] - 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [57] - 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [58] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x0a\x08\xaa\xaa\x02\x02\x00", # [53,54,56,57,61,64..72,76] + 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [68] + 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [69] + 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [76] + 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [61] + 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [70] + 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [71] + 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [72] + 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [64] + 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [56] + 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [57] 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [54] - 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [68] - 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [66] - 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [67] + 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [67] + 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [65] + 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [66] 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [46] @@ -267,10 +264,10 @@ our %DeadBits = ( 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [5..11,55] 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] - 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [59] + 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [58] 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] - 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [60] + 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [59] 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [50] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [51] @@ -287,13 +284,13 @@ our %DeadBits = ( 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] - 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [61] + 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [60] 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] - 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [74] + 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [73] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] - 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [64] + 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [63] 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [52] @@ -312,6 +309,7 @@ our %DeadBits = ( our %NoOp = ( 'experimental::alpha_assertions' => 1, 'experimental::bitwise' => 1, + 'experimental::const_attr' => 1, 'experimental::isa' => 1, 'experimental::lexical_subs' => 1, 'experimental::postderef' => 1, @@ -322,8 +320,8 @@ our %NoOp = ( # These are used by various things, including our own tests our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x05\x00\x55\x50\x54\x55\x45\x55\x05"; # [2,4,22,23,25,48,49,56..59,62,63,65..73,75..81] -our $LAST_BIT = 164 ; +our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x05\x00\x15\x14\x55\x55\x51\x55\x01"; # [2,4,22,23,25,48,49,56..58,61,62,64..72,74..80] +our $LAST_BIT = 162 ; our $BYTES = 21 ; sub Croaker @@ -954,8 +952,6 @@ The current hierarchy is: | | | +- experimental::class | | - | +- experimental::const_attr - | | | +- experimental::declared_refs | | | +- experimental::defer diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 0387d8f7b480..ca54f1e48197 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2041,13 +2041,6 @@ to define an overloaded constant, or when trying to find the character name specified in the C<\N{...}> escape. Perhaps you forgot to load the corresponding L pragma? -=item :const is experimental - -(S experimental::const_attr) The "const" attribute is experimental. -If you want to use the feature, disable the warning with C, but know that in doing so you are taking -the risk that your code may break in a future Perl version. - =item :const is not permitted on named subroutines (F) The "const" attribute causes an anonymous subroutine to be run and diff --git a/pod/perlexperiment.pod b/pod/perlexperiment.pod index be781384a3e4..ce84d0dd73b3 100644 --- a/pod/perlexperiment.pod +++ b/pod/perlexperiment.pod @@ -55,18 +55,6 @@ L<[perl #14150]|https://github.com/Perl/perl5/issues/14150>. See also: L -=item The "const" attribute - -Introduced in Perl 5.22.0 - -Using this feature triggers warnings in the category -C. - -The ticket for this experiment is -L<[perl #14428]|https://github.com/Perl/perl5/issues/14428>. - -See also: L - =item use re 'strict'; Introduced in Perl 5.22.0 @@ -372,6 +360,14 @@ Introduced in Perl 5.34.0. Accepted in Perl 5.40 when not using the optional C block. +=item The "const" attribute + +Introduced in Perl 5.22.0 + +Accepted in Perl 5.40 + +See also: L + =back =head2 Removed features diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 642d7f36e353..186ccc8d1f5d 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -1785,11 +1785,11 @@ aside from where it is declared. *ALSO_INLINED = sub () { $x }; } -Perl 5.22 also introduces the experimental "const" attribute as an -alternative. (Disable the "experimental::const_attr" warnings if you want -to use it.) When applied to an anonymous subroutine, it forces the sub to -be called when the C expression is evaluated. The return value is -captured and turned into a constant subroutine: +Perl 5.22 also introduced the "const" attribute as an alternative. It was +initially experimental, but made stable in Perl 5.40. When applied to an +anonymous subroutine, it forces the sub to be called when the C +expression is evaluated. The return value is captured and turned into a +constant subroutine: my $x = 54321; *INLINED = sub : const { $x }; diff --git a/regen/warnings.pl b/regen/warnings.pl index 230b84f3db3f..e6572952b1de 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -194,6 +194,7 @@ BEGIN experimental::script_run experimental::isa experimental::smartmatch + experimental::const_attr ); ########################################################################### diff --git a/t/op/anonconst.t b/t/op/anonconst.t index 89a6acbabafa..ed545d6ded33 100644 --- a/t/op/anonconst.t +++ b/t/op/anonconst.t @@ -6,17 +6,6 @@ BEGIN { set_up_inc("../lib"); } -plan 8; - -{ - my $w; - local $SIG{__WARN__} = sub { $w .= shift }; - eval '+sub : const {}'; - like $w, qr/^:const is experimental at /, 'experimental warning'; -} - -no warnings 'experimental::const_attr'; - push @subs, sub :const{$_} for 1..10; is join(" ", map &$_, @subs), "1 2 3 4 5 6 7 8 9 10", ':const capturing global $_'; @@ -49,3 +38,5 @@ like $@, qr/^:const is not permitted on named subroutines at /, eval 'sub baz : const { }'; like $@, qr/^:const is not permitted on named subroutines at /, ':const on named sub'; + +done_testing; diff --git a/toke.c b/toke.c index bf3358cdd40d..45b1e4b206bb 100644 --- a/toke.c +++ b/toke.c @@ -12857,10 +12857,6 @@ S_apply_builtin_cv_attribute(pTHX_ CV *cv, OP *o) else if(memEQs(SvPVX(sv), len, "method")) CvNOWARN_AMBIGUOUS_on(cv); else if(memEQs(SvPVX(sv), len, "const")) { - Perl_ck_warner_d(aTHX_ - packWARN(WARN_EXPERIMENTAL__CONST_ATTR), - ":const is experimental" - ); CvANONCONST_on(cv); if (!CvANON(cv)) yyerror(":const is not permitted on named subroutines"); diff --git a/warnings.h b/warnings.h index 5b8a22d30e7d..93f2fc0e91a7 100644 --- a/warnings.h +++ b/warnings.h @@ -102,71 +102,70 @@ /* Warnings Categories added in Perl 5.021 */ -#define WARN_EXPERIMENTAL__CONST_ATTR 56 -#define WARN_EXPERIMENTAL__RE_STRICT 57 -#define WARN_EXPERIMENTAL__REFALIASING 58 -#define WARN_LOCALE 59 -#define WARN_MISSING 60 -#define WARN_REDUNDANT 61 +#define WARN_EXPERIMENTAL__RE_STRICT 56 +#define WARN_EXPERIMENTAL__REFALIASING 57 +#define WARN_LOCALE 58 +#define WARN_MISSING 59 +#define WARN_REDUNDANT 60 /* Warnings Categories added in Perl 5.025 */ -#define WARN_EXPERIMENTAL__DECLARED_REFS 62 +#define WARN_EXPERIMENTAL__DECLARED_REFS 61 /* Warnings Categories added in Perl 5.025011 */ -#define WARN_DEPRECATED__DOT_IN_INC 63 +#define WARN_DEPRECATED__DOT_IN_INC 62 /* Warnings Categories added in Perl 5.027 */ -#define WARN_SHADOW 64 +#define WARN_SHADOW 63 /* Warnings Categories added in Perl 5.029 */ -#define WARN_EXPERIMENTAL__PRIVATE_USE 65 -#define WARN_EXPERIMENTAL__UNIPROP_WILDCARDS 66 -#define WARN_EXPERIMENTAL__VLB 67 +#define WARN_EXPERIMENTAL__PRIVATE_USE 64 +#define WARN_EXPERIMENTAL__UNIPROP_WILDCARDS 65 +#define WARN_EXPERIMENTAL__VLB 66 /* Warnings Categories added in Perl 5.033 */ -#define WARN_EXPERIMENTAL__TRY 68 +#define WARN_EXPERIMENTAL__TRY 67 /* Warnings Categories added in Perl 5.035 */ -#define WARN_EXPERIMENTAL__ARGS_ARRAY_WITH_SIGNATURES 69 -#define WARN_EXPERIMENTAL__BUILTIN 70 -#define WARN_EXPERIMENTAL__DEFER 71 -#define WARN_EXPERIMENTAL__EXTRA_PAIRED_DELIMITERS 72 -#define WARN_EXPERIMENTAL__FOR_LIST 73 -#define WARN_SCALAR 74 +#define WARN_EXPERIMENTAL__ARGS_ARRAY_WITH_SIGNATURES 68 +#define WARN_EXPERIMENTAL__BUILTIN 69 +#define WARN_EXPERIMENTAL__DEFER 70 +#define WARN_EXPERIMENTAL__EXTRA_PAIRED_DELIMITERS 71 +#define WARN_EXPERIMENTAL__FOR_LIST 72 +#define WARN_SCALAR 73 /* Warnings Categories added in Perl 5.035009 */ -#define WARN_DEPRECATED__VERSION_DOWNGRADE 75 +#define WARN_DEPRECATED__VERSION_DOWNGRADE 74 /* Warnings Categories added in Perl 5.03501 */ -#define WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED 76 +#define WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED 75 /* Warnings Categories added in Perl 5.037 */ -#define WARN_EXPERIMENTAL__CLASS 77 +#define WARN_EXPERIMENTAL__CLASS 76 /* Warnings Categories added in Perl 5.037009 */ -#define WARN_DEPRECATED__APOSTROPHE_AS_PACKAGE_SEPARATOR 78 +#define WARN_DEPRECATED__APOSTROPHE_AS_PACKAGE_SEPARATOR 77 /* Warnings Categories added in Perl 5.03701 */ -#define WARN_DEPRECATED__SMARTMATCH 79 +#define WARN_DEPRECATED__SMARTMATCH 78 /* Warnings Categories added in Perl 5.039002 */ -#define WARN_DEPRECATED__MISSING_IMPORT_CALLED_WITH_ARGS 80 +#define WARN_DEPRECATED__MISSING_IMPORT_CALLED_WITH_ARGS 79 /* Warnings Categories added in Perl 5.039008 */ -#define WARN_DEPRECATED__SUBSEQUENT_USE_VERSION 81 +#define WARN_DEPRECATED__SUBSEQUENT_USE_VERSION 80 #define WARNsize 21 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125" #define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" @@ -337,7 +336,6 @@ category parameters passed. =for apidoc Amnh||WARN_EXPERIMENTAL =for apidoc Amnh||WARN_EXPERIMENTAL__REGEX_SETS =for apidoc Amnh||WARN_SYSCALLS -=for apidoc Amnh||WARN_EXPERIMENTAL__CONST_ATTR =for apidoc Amnh||WARN_EXPERIMENTAL__RE_STRICT =for apidoc Amnh||WARN_EXPERIMENTAL__REFALIASING =for apidoc Amnh||WARN_LOCALE