This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.h: Combine two macros into one
[perl5.git] / pad.c
diff --git a/pad.c b/pad.c
index c0098be..2bbb056 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -121,6 +121,8 @@ to be generated in evals, such as
 For state vars, C<SVs_PADSTALE> is overloaded to mean 'not yet initialised',
 but this internal state is stored in a separate pad entry.
 
+=for apidoc Amnh||SVs_PADSTALE
+
 =for apidoc AmnxU|PADNAMELIST *|PL_comppad_name
 
 During compilation, this points to the array containing the names part
@@ -1086,10 +1088,10 @@ S_unavailable(pTHX_ PADNAME *name)
 {
     /* diag_listed_as: Variable "%s" is not available */
     Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE),
-                       "%se \"%" PNf "\" is not available",
+                       "%s \"%" PNf "\" is not available",
                         *PadnamePV(name) == '&'
-                                        ? "Subroutin"
-                                        : "Variabl",
+                                        ? "Subroutine"
+                                        : "Variable",
                         PNfARG(name));
 }
 
@@ -1205,8 +1207,8 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
                        /* diag_listed_as: Variable "%s" will not stay
                                           shared */
                        Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
-                           "%se \"%" UTF8f "\" will not stay shared",
-                            *namepv == '&' ? "Subroutin" : "Variabl",
+                           "%s \"%" UTF8f "\" will not stay shared",
+                            *namepv == '&' ? "Subroutine" : "Variable",
                             UTF8fARG(1, namelen, namepv));
                    }
 
@@ -2127,7 +2129,6 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, HV *cloned,
         * from the parent */
        if (const_sv && SvREFCNT(const_sv) == 2) {
            const bool was_method = cBOOL(CvMETHOD(cv));
-           bool copied = FALSE;
            if (outside) {
                PADNAME * const pn =
                    PadlistNAMESARRAY(CvPADLIST(outside))
@@ -2156,28 +2157,15 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, HV *cloned,
                        ) == o
                     && !OpSIBLING(o))
                    {
-                       Perl_ck_warner_d(aTHX_
-                                         packWARN(WARN_DEPRECATED),
-                                        "Constants from lexical "
-                                        "variables potentially "
-                                        "modified elsewhere are "
-                                        "deprecated. This will not "
-                                         "be allowed in Perl 5.32");
-                       /* We *copy* the lexical variable, and donate the
-                          copy to newCONSTSUB.  Yes, this is ugly, and
-                          should be killed.  We need to do this for the
-                          time being, however, because turning on SvPADTMP
-                          on a lexical will have observable effects
-                          elsewhere.  */
-                       const_sv = newSVsv(const_sv);
-                       copied = TRUE;
+                        Perl_croak(aTHX_
+                            "Constants from lexical variables potentially modified "
+                            "elsewhere are no longer permitted");
                    }
                    else
                        goto constoff;
                }
            }
-           if (!copied)
-               SvREFCNT_inc_simple_void_NN(const_sv);
+            SvREFCNT_inc_simple_void_NN(const_sv);
            /* If the lexical is not used elsewhere, it is safe to turn on
               SvPADTMP, since it is only when it is used in lvalue con-
               text that the difference is observable.  */
@@ -2279,6 +2267,8 @@ If C<flags> has the C<CV_NAME_NOTQUAL> bit set, then the package name will not b
 included.  If the first argument is neither a CV nor a GV, this flag is
 ignored (subject to change).
 
+=for apidoc Amnh||CV_NAME_NOTQUAL
+
 =cut
 */
 
@@ -2764,6 +2754,8 @@ that refer to outer lexicals.  (See also L</newPADNAMEpvn>.)  C<outer> is
 the outer pad name that this one mirrors.  The returned pad name has the
 C<PADNAMEt_OUTER> flag already set.
 
+=for apidoc Amnh||PADNAMEt_OUTER
+
 =cut
 */