In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/d0761305e645847e893799c475b2a24d15afbcd0?hp=8e3171984bd6a5f4edf04ec5b91032d053bdd8a5>

- Log -----------------------------------------------------------------
commit d0761305e645847e893799c475b2a24d15afbcd0
Author: Father Chrysostomos <[email protected]>
Date:   Sat Nov 24 00:31:01 2012 -0800

    Stop sub decl redef warnings from leaking CVs
    
    When newMYSUB and newATTRSUB are called, PL_compcv has an unclaimed
    reference count, so any code that croaks must decrement the reference
    count or make arrangements for such to happen.
    
    This commit applies only to redefinition warnings triggered by sub
    declarations, like ‘sub foo {}’ and ‘my sub foo {}’.

M       op.c
M       t/op/svleak.t

commit 58d67a2773e32367cd7f045a3afaebf08da91194
Author: Father Chrysostomos <[email protected]>
Date:   Sat Nov 24 00:24:25 2012 -0800

    perldiag: Correct wording of ‘Using just the first char...’

M       pod/perldiag.pod

commit 687531b57f8d0312f4d2044c692a7c9514472f85
Author: Father Chrysostomos <[email protected]>
Date:   Sat Nov 24 00:20:17 2012 -0800

    perldiag: Add cat to ‘Using just the first char...’

M       pod/perldiag.pod

commit c732bbdcdefee234a43597f835893a13be397daf
Author: Father Chrysostomos <[email protected]>
Date:   Sat Nov 24 00:19:05 2012 -0800

    Increase $feature::VERSION to 1.32

M       lib/feature.pm
M       regen/feature.pl

commit 64fbf0dd43246bda0d854a4cbf1884b785d4d890
Author: Father Chrysostomos <[email protected]>
Date:   Sat Nov 24 00:10:15 2012 -0800

    Warn when declaring lexsubs, not when enabling them
    
    feature.pm has an ":all" tag.  So if we warn when lexical subs are
    enabled, then ‘use feature ":all"’ will also warn.  That’s unkind.
    
    Instead, warn when a lexical sub is declared via
    ‘my/our/state sub...’.

M       lib/feature.pm
M       pod/perldiag.pod
M       regen/feature.pl
M       t/cmd/lexsub.t
M       t/lib/croak/toke
M       t/lib/warnings/op
M       t/lib/warnings/toke
M       t/porting/diag.t
M       toke.c

commit 2b141370e47820eefd315393146f44b116c3b058
Author: Father Chrysostomos <[email protected]>
Date:   Fri Nov 23 23:47:05 2012 -0800

    op.c: Factor common ‘existing sub’ logic into static routine
    
    newMYSUB and newATTRSUB are very similar but differ in small ways
    throughout.  This particular block of code is close enough it can be
    moved into a separate static routine to avoid repetition.

M       op.c

commit ee0832ceab256e5d1ed74d0767fa3bd420bc5bd6
Author: Father Chrysostomos <[email protected]>
Date:   Fri Nov 23 23:44:49 2012 -0800

    Warn by default for constant my sub redefinition
    
    I apparently never had this working and never tested it either.
    
    I was checking whether the new sub was a constant, rather than the one
    it was clobbering.

M       op.c
M       t/lib/warnings/op

commit 4ded55f35550b45910091ebeac7889f08d209fe4
Author: Father Chrysostomos <[email protected]>
Date:   Fri Nov 23 23:32:55 2012 -0800

    Prevent double frees with lexical constants
    
    my sub foo() { 2 }
    
    This produces a double free, because SAVEPADSVANDMORTALIZE causes the
    reference count to go down on scope exit, and nothing was increment-
    ing it to compensate.

M       pp.c
M       t/cmd/lexsub.t

commit 7e18702058e5564da44e84546c67056637b62d83
Author: Father Chrysostomos <[email protected]>
Date:   Fri Nov 23 20:40:39 2012 -0800

    op.c:newATTRSUB: Change an if condition to an else
    
    In one spot we have if(blah blah balh) {...} followed by
    if (<exactly the opposite>).  We can just change the second if to
    an else, since the condition is not going to change here.
    
    This brings newATTRSUB and newMYSUB slightly closer, allowing me
    to factor some of it out into a static routine in the next commit.

M       op.c

commit 8daf8916b49984fc91791e8265cd7e1ca36b836c
Author: Father Chrysostomos <[email protected]>
Date:   Fri Nov 23 20:32:49 2012 -0800

    Stop ignored :lvalue warning from leaking CVs
    
    When newMYSUB and newATTRSUB are called, PL_compcv has an unclaimed
    reference count, so any code that croaks must decrement the reference
    count or make arrangements for such to happen.

M       op.c
M       t/op/svleak.t
-----------------------------------------------------------------------

Summary of changes:
 lib/feature.pm      |   14 +----
 op.c                |  139 +++++++++++++++++++++++---------------------------
 pod/perldiag.pod    |   21 ++++----
 pp.c                |    2 +-
 regen/feature.pl    |   18 +++----
 t/cmd/lexsub.t      |   21 +++++---
 t/lib/croak/toke    |    2 +-
 t/lib/warnings/op   |   22 ++++++++
 t/lib/warnings/toke |    4 +-
 t/op/svleak.t       |    2 +-
 t/porting/diag.t    |    3 +-
 toke.c              |    3 +
 12 files changed, 132 insertions(+), 119 deletions(-)

diff --git a/lib/feature.pm b/lib/feature.pm
index 46b43a8..d45174c 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -5,7 +5,7 @@
 
 package feature;
 
-our $VERSION = '1.31';
+our $VERSION = '1.32';
 
 our %feature = (
     fc              => 'feature_fc',
@@ -35,9 +35,6 @@ $feature_bundle{"5.16"} = $feature_bundle{"5.15"};
 $feature_bundle{"5.17"} = $feature_bundle{"5.15"};
 $feature_bundle{"5.18"} = $feature_bundle{"5.15"};
 $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"};
-my %experimental = (
-    lexical_subs => 1,
-);
 
 our $hint_shift   = 26;
 our $hint_mask    = 0x1c000000;
@@ -233,8 +230,8 @@ This feature is available from Perl 5.16 onwards.
 =head2 The 'lexical_subs' feature
 
 B<WARNING>: This feature is still experimental and the implementation may
-change in future versions of Perl.  For this reason, F<feature.pm> will
-warn when you enable the feature, unless you have explicitly disabled the
+change in future versions of Perl.  For this reason, Perl will
+warn when you use the feature, unless you have explicitly disabled the
 warning:
 
     no warnings "experimental::lexical_subs";
@@ -380,11 +377,6 @@ sub __common {
        if ($import) {
            $^H{$feature{$name}} = 1;
            $^H |= $hint_uni8bit if $name eq 'unicode_strings';
-           if ($experimental{$name}) {
-               require warnings;
-               warnings::warnif("experimental::$name",
-                                "The $name feature is experimental");
-           }
        } else {
             delete $^H{$feature{$name}};
             $^H &= ~ $hint_uni8bit if $name eq 'unicode_strings';
diff --git a/op.c b/op.c
index 1b4cf8d..8efc898 100644
--- a/op.c
+++ b/op.c
@@ -6912,6 +6912,64 @@ Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
     return sv;
 }
 
+static bool
+S_already_defined(pTHX_ CV *const cv, OP * const block, OP * const o,
+                       PADNAME * const name, SV ** const const_svp)
+{
+    assert (cv);
+    assert (o || name);
+    assert (const_svp);
+    if ((!block
+#ifdef PERL_MAD
+        || block->op_type == OP_NULL
+#endif
+        )) {
+       if (CvFLAGS(PL_compcv)) {
+           /* might have had built-in attrs applied */
+           const bool pureperl = !CvISXSUB(cv) && CvROOT(cv);
+           if (CvLVALUE(PL_compcv) && ! CvLVALUE(cv) && pureperl
+            && ckWARN(WARN_MISC))
+           {
+               /* protect against fatal warnings leaking compcv */
+               SAVEFREESV(PL_compcv);
+               Perl_warner(aTHX_ packWARN(WARN_MISC), "lvalue attribute 
ignored after the subroutine has been defined");
+               SvREFCNT_inc_simple_void_NN(PL_compcv);
+           }
+           CvFLAGS(cv) |=
+               (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS
+                 & ~(CVf_LVALUE * pureperl));
+       }
+       return FALSE;
+    }
+
+    /* redundant check for speed: */
+    if (CvCONST(cv) || ckWARN(WARN_REDEFINE)) {
+       const line_t oldline = CopLINE(PL_curcop);
+       SV *namesv = o
+           ? cSVOPo->op_sv
+           : sv_2mortal(newSVpvn_utf8(
+               PadnamePV(name)+1,PadnameLEN(name)-1, PadnameUTF8(name)
+             ));
+       if (PL_parser && PL_parser->copline != NOLINE)
+            /* This ensures that warnings are reported at the first
+               line of a redefinition, not the last.  */
+           CopLINE_set(PL_curcop, PL_parser->copline);
+       /* protect against fatal warnings leaking compcv */
+       SAVEFREESV(PL_compcv);
+       report_redefined_cv(namesv, cv, const_svp);
+       SvREFCNT_inc_simple_void_NN(PL_compcv);
+       CopLINE_set(PL_curcop, oldline);
+    }
+#ifdef PERL_MAD
+    if (!PL_minus_c)   /* keep old one around for madskills */
+#endif
+    {
+       /* (PL_madskills unset in used file.) */
+       SvREFCNT_dec(cv);
+    }
+    return TRUE;
+}
+
 CV *
 Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
 {
@@ -7028,49 +7086,14 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP 
*attrs, OP *block)
             cv_ckproto_len_flags(cv, (GV *)name, ps, ps_len, ps_utf8);
        /* already defined? */
        if (exists) {
-           if ((!block
-#ifdef PERL_MAD
-                || block->op_type == OP_NULL
-#endif
-                )) {
-               if (CvFLAGS(compcv)) {
-                   /* might have had built-in attrs applied */
-                   const bool pureperl = !CvISXSUB(cv) && CvROOT(cv);
-                   if (CvLVALUE(compcv) && ! CvLVALUE(cv) && pureperl
-                    && ckWARN(WARN_MISC))
-                       Perl_warner(aTHX_ packWARN(WARN_MISC), "lvalue 
attribute ignored after the subroutine has been defined");
-                   CvFLAGS(cv) |=
-                       (CvFLAGS(compcv) & CVf_BUILTIN_ATTRS
-                         & ~(CVf_LVALUE * pureperl));
-               }
+           if (S_already_defined(aTHX_ cv, block, NULL, name, &const_sv))
+               cv = NULL;
+           else {
                if (attrs) goto attrs;
                /* just a "sub foo;" when &foo is already defined */
                SAVEFREESV(compcv);
                goto done;
            }
-           else {
-               /* redundant check that avoids creating the extra SV
-                  most of the time: */
-               if (const_sv || ckWARN(WARN_REDEFINE)) {
-                   const line_t oldline = CopLINE(PL_curcop);
-                   SV *noamp = sv_2mortal(newSVpvn_utf8(
-                                   PadnamePV(name)+1,PadnameLEN(name)-1,
-                                    PadnameUTF8(name)
-                               ));
-                   if (PL_parser && PL_parser->copline != NOLINE)
-                       CopLINE_set(PL_curcop, PL_parser->copline);
-                   report_redefined_cv(noamp, cv, &const_sv);
-                   CopLINE_set(PL_curcop, oldline);
-               }
-#ifdef PERL_MAD
-               if (!PL_minus_c)        /* keep old one around for madskills */
-#endif
-                   {
-                       /* (PL_madskills unset in used file.) */
-                       SvREFCNT_dec(cv);
-                   }
-               cv = NULL;
-           }
        }
        else if (CvDEPTH(outcv) && CvCLONE(compcv)) {
            cv = NULL;
@@ -7434,48 +7457,14 @@ Perl_newATTRSUB_flags(pTHX_ I32 floor, OP *o, OP 
*proto, OP *attrs,
             cv_ckproto_len_flags(cv, gv, ps, ps_len, ps_utf8);
        /* already defined (or promised)? */
        if (exists || GvASSUMECV(gv)) {
-           if ((!block
-#ifdef PERL_MAD
-                || block->op_type == OP_NULL
-#endif
-                )) {
-               if (CvFLAGS(PL_compcv)) {
-                   /* might have had built-in attrs applied */
-                   const bool pureperl = !CvISXSUB(cv) && CvROOT(cv);
-                   if (CvLVALUE(PL_compcv) && ! CvLVALUE(cv) && pureperl
-                    && ckWARN(WARN_MISC))
-                       Perl_warner(aTHX_ packWARN(WARN_MISC), "lvalue 
attribute ignored after the subroutine has been defined");
-                   CvFLAGS(cv) |=
-                       (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS
-                         & ~(CVf_LVALUE * pureperl));
-               }
+           if (S_already_defined(aTHX_ cv, block, o, NULL, &const_sv))
+               cv = NULL;
+           else {
                if (attrs) goto attrs;
                /* just a "sub foo;" when &foo is already defined */
                SAVEFREESV(PL_compcv);
                goto done;
            }
-           if (block
-#ifdef PERL_MAD
-               && block->op_type != OP_NULL
-#endif
-               ) {
-               const line_t oldline = CopLINE(PL_curcop);
-               if (PL_parser && PL_parser->copline != NOLINE) {
-                        /* This ensures that warnings are reported at the first
-                           line of a redefinition, not the last.  */
-                       CopLINE_set(PL_curcop, PL_parser->copline);
-                }
-               report_redefined_cv(cSVOPo->op_sv, cv, &const_sv);
-               CopLINE_set(PL_curcop, oldline);
-#ifdef PERL_MAD
-               if (!PL_minus_c)        /* keep old one around for madskills */
-#endif
-                   {
-                       /* (PL_madskills unset in used file.) */
-                       SvREFCNT_dec(cv);
-                   }
-               cv = NULL;
-           }
        }
     }
     if (const_sv) {
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 1507d6d..1a21297 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -4788,16 +4788,17 @@ think the U.S. Government thinks it's a secret, or at 
least that they
 will continue to pretend that it is.  And if you quote me on that, I
 will deny it.
 
-=item The %s feature is experimental
+=item The lexical_subs feature is experimental
 
-(S experimental) This warning is emitted if you enable an experimental
-feature via C<use feature>.  Simply suppress the warning if you want
-to use the feature, but know that in doing so you are taking the risk
-of using an experimental feature which may change or be removed in a
-future Perl version:
+(S experimental::lexical_subs) This warning is emitted if you
+declare a sub with C<my> or C<state>.  Simply suppress the warning
+if you want to use the feature, but know that in doing so you
+are taking the risk of using an experimental feature which may
+change or be removed in a future Perl version:
 
     no warnings "experimental::lexical_subs";
     use feature "lexical_subs";
+    my sub foo { ... }
 
 =item The %s function is unimplemented
 
@@ -5652,11 +5653,11 @@ C<< @foo->[23] >> or C<< @$ref->[99] >>.  Versions of 
perl <= 5.6.1 used to
 allow this syntax, but shouldn't have.  It is now deprecated,
 and will be removed in a future version.
 
-=item Using just the first character returned by \N{} in character class
+=item Using just the first character returned by \N{} in character class in 
regex; marked by <-- HERE in m/%s/
 
-(W) A charnames handler may return a sequence of more than one character.
-Currently all but the first one are discarded when used in a regular
-expression pattern bracketed character class.
+(W regexp) A charnames handler may return a sequence of more than one
+character.  Currently all but the first one are discarded when used in
+a regular expression pattern bracketed character class.
 
 =item Using !~ with %s doesn't make sense
 
diff --git a/pp.c b/pp.c
index 8e4c4a6..e1c9d75 100644
--- a/pp.c
+++ b/pp.c
@@ -174,7 +174,7 @@ PP(pp_clonecv)
        /* If this changes to use SAVECLEARSV, we can move the SAVECLEARSV
           to introcv and remove the SvPADSTALE_off. */
        SAVEPADSVANDMORTALIZE(ARGTARG);
-       PAD_SVl(ARGTARG) = mg->mg_obj;
+       PAD_SVl(ARGTARG) = SvREFCNT_inc_simple_NN(mg->mg_obj);
     }
     else {
        if (CvROOT(mg->mg_obj)) {
diff --git a/regen/feature.pl b/regen/feature.pl
index e1f30df..89ba0c9 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -52,6 +52,7 @@ my %feature_bundle = (
                    evalbytes current_sub fc)],
 );
 
+# not actually used currently
 my @experimental = qw( lexical_subs );
 
 
@@ -175,9 +176,9 @@ for (sort keys %Aliases) {
        qq'\$feature_bundle{"$_"} = \$feature_bundle{"$Aliases{$_}"};\n';
 };
 
-print $pm "my \%experimental = (\n";
-print $pm "    $_ => 1,\n", for @experimental;
-print $pm ");\n";
+#print $pm "my \%experimental = (\n";
+#print $pm "    $_ => 1,\n", for @experimental;
+#print $pm ");\n";
 
 print $pm <<EOPM;
 
@@ -355,7 +356,7 @@ read_only_bottom_close_and_rename($h);
 __END__
 package feature;
 
-our $VERSION = '1.31';
+our $VERSION = '1.32';
 
 FEATURES
 
@@ -544,8 +545,8 @@ This feature is available from Perl 5.16 onwards.
 =head2 The 'lexical_subs' feature
 
 B<WARNING>: This feature is still experimental and the implementation may
-change in future versions of Perl.  For this reason, F<feature.pm> will
-warn when you enable the feature, unless you have explicitly disabled the
+change in future versions of Perl.  For this reason, Perl will
+warn when you use the feature, unless you have explicitly disabled the
 warning:
 
     no warnings "experimental::lexical_subs";
@@ -678,11 +679,6 @@ sub __common {
        if ($import) {
            $^H{$feature{$name}} = 1;
            $^H |= $hint_uni8bit if $name eq 'unicode_strings';
-           if ($experimental{$name}) {
-               require warnings;
-               warnings::warnif("experimental::$name",
-                                "The $name feature is experimental");
-           }
        } else {
             delete $^H{$feature{$name}};
             $^H &= ~ $hint_uni8bit if $name eq 'unicode_strings';
diff --git a/t/cmd/lexsub.t b/t/cmd/lexsub.t
index 06ee24c..86c7e26 100644
--- a/t/cmd/lexsub.t
+++ b/t/cmd/lexsub.t
@@ -8,7 +8,7 @@ BEGIN {
     *bar::like = *like;
 }
 no warnings 'deprecated';
-plan 127;
+plan 128;
 
 # -------------------- Errors with feature disabled -------------------- #
 
@@ -206,7 +206,7 @@ package main;
   is $y, 44, 'state subs from other packages override all keywords';
 }
 {
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   state $w ;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval '#line 87 squidges
@@ -234,7 +234,7 @@ is &$sub2, 49, 'state sub in closure (2)';
 # But we need to test that state subs actually do persist from one invoca-
 # tion of a named sub to another (i.e., that they are not my subs).
 {
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   state $w;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval '#line 65 teetet
@@ -287,7 +287,7 @@ sub make_anon_with_state_sub{
 }
 {
   state sub redef {}
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   state $w;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval "#line 56 pygpyf\nsub redef {}";
@@ -428,7 +428,7 @@ package main;
   is $y, 44, 'my subs from other packages override all keywords';
 }
 {
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   my $w ;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval '#line 87 squidges
@@ -454,7 +454,7 @@ is &$sub1, 48, 'my sub in closure (1)';
 is &$sub2, 49, 'my sub in closure (2)';
 # Test that they are cloned in named subs.
 {
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   my $w;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval '#line 65 teetet
@@ -521,7 +521,7 @@ sub make_anon_with_my_sub{
 }
 {
   my sub redef {}
-  use warnings;
+  use warnings; no warnings "experimental::lexical_subs";
   my $w;
   local $SIG{__WARN__} = sub { $w .= shift };
   eval "#line 56 pygpyf\nsub redef {}";
@@ -601,6 +601,13 @@ not_lexical11();
   is x, 3, 'my sub defined inside eval';
 }
 
+{
+  state $w;
+  local $SIG{__WARN__} = sub { $w .= shift };
+  eval q{ my sub george () { 2 } };
+  is $w, undef, 'no double free from constant my subs';
+}
+
 # -------------------- Interactions (and misc tests) -------------------- #
 
 is sub {
diff --git a/t/lib/croak/toke b/t/lib/croak/toke
index 01cb751..acfab57 100644
--- a/t/lib/croak/toke
+++ b/t/lib/croak/toke
@@ -25,7 +25,7 @@ Missing name in "our sub" at - line 1.
 use 5.01; use feature 'lexical_subs';
 state sub;
 EXPECT
-The lexical_subs feature is experimental at - line 1.
+The lexical_subs feature is experimental at - line 2.
 Missing name in "state sub" at - line 2.
 ########
 # NAME Unterminated delimiter for here document
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index 52b35b6..3e9ea41 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -778,6 +778,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 }
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index 0b540ec..7d66ab6 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -1160,13 +1160,15 @@ sub proto_after_array(@$);
 sub proto_after_hash(%$);
 sub underscore_fail($_$);
 EXPECT
-The lexical_subs feature is experimental at - line 2.
 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.
diff --git a/t/op/svleak.t b/t/op/svleak.t
index 11ce8de..e3f6be4 100644
--- a/t/op/svleak.t
+++ b/t/op/svleak.t
@@ -78,7 +78,6 @@ eleak(2, 0, "$all /\$\\ /", '/$\ / with fatal warnings');
 eleak(2, 0, "$all s//\\1/", 's//\1/ with fatal warnings');
 eleak(2, 0, "$all qq|\\i|", 'qq|\i| with fatal warnings');
 eleak(2, 0, "$f 'digit'; qq|\\o{9}|", 'qq|\o{9}| with fatal warnings');
-$::TODO = 'still leaks';
 eleak(2, 0, "$f 'misc'; sub foo{} sub foo:lvalue",
      'ignored :lvalue with fatal warnings');
 eleak(2, 0, "no warnings; use feature ':all'; $f 'misc';
@@ -88,6 +87,7 @@ eleak(2, 0, "no warnings; use feature ':all'; $all
              my sub foo{} sub foo:lvalue{}",
      'fatal mysub redef warning');
 eleak(2, 0, "$all sub foo{} sub foo{}", 'fatal sub redef warning');
+$::TODO = 'still leaks';
 eleak(2, 0, "$all *x=sub {}",
      'fatal sub redef warning with sub-to-glob assignment');
 eleak(2, 0, "$all *x=sub() {1}",
diff --git a/t/porting/diag.t b/t/porting/diag.t
index 4dcdf3b..a060268 100644
--- a/t/porting/diag.t
+++ b/t/porting/diag.t
@@ -78,7 +78,7 @@ my $cur_entry;
 open my $diagfh, "<", $pod
   or die "Can't open $pod: $!";
 
-my $category_re = qr/ [a-z0-9_]+?/;      # Note: requires an initial space
+my $category_re = qr/ [a-z0-9_:]+?/;    # Note: requires an initial space
 my $severity_re = qr/ . (?: \| . )* /x; # A severity is a single char, but can
                                         # be of the form 'S|P|W'
 my @same_descr;
@@ -296,6 +296,7 @@ sub check_file {
                  :                                '[PFX]';
     my $categories;
     if (defined $category) {
+      $category =~ s/__/::/g;
       $categories =
         join ", ",
               sort map {s/^WARN_//; lc $_} split /\s*[|,]\s*/, $category;
diff --git a/toke.c b/toke.c
index 32367bc..9ae733c 100644
--- a/toke.c
+++ b/toke.c
@@ -8022,6 +8022,9 @@ Perl_yylex(pTHX)
                                  "Experimental \"%s\" subs not enabled",
                                   tmp == KEY_my    ? "my"    :
                                   tmp == KEY_state ? "state" : "our");
+                   Perl_ck_warner_d(aTHX_
+                       packWARN(WARN_EXPERIMENTAL__LEXICAL_SUBS),
+                       "The lexical_subs feature is experimental");
                    goto really_sub;
                }
                PL_in_my_stash = find_in_my_stash(PL_tokenbuf, len);

--
Perl5 Master Repository

Reply via email to