From: Rafael Garcia-Suarez Date: Tue, 12 Jan 2010 07:03:58 +0000 (+0100) Subject: The new lvalue warning should not be turned on by default X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=963d9ce9328cdf8ad93ac7ab1d69b3613d5c4d1b;p=p5sagit%2Fp5-mst-13.2.git The new lvalue warning should not be turned on by default A check for the warning category was missing from commit 885ef6f56b61fd750ef3b1fa614d11480baac635. Also, document the warning category in perldiag. --- diff --git a/op.c b/op.c index a7205cb..5619622 100644 --- a/op.c +++ b/op.c @@ -5714,7 +5714,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) )&& !attrs) { if (CvFLAGS(PL_compcv)) { /* might have had built-in attrs applied */ - if (CvLVALUE(PL_compcv) && ! CvLVALUE(cv)) + if (CvLVALUE(PL_compcv) && ! CvLVALUE(cv) && 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); } diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 2b8d2c0..34935ef 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2309,7 +2309,7 @@ instead on the filehandle.) =item lvalue attribute ignored after the subroutine has been defined -(W) Making a subroutine an lvalue subroutine after it has been defined +(W misc) Making a subroutine an lvalue subroutine after it has been defined by declaring the subroutine with a lvalue attribute is not possible. To make the the subroutine a lvalue subroutine add the lvalue attribute to the definition, or put the the declaration before