diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-10-05 23:27:54 +0200 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2003-10-06 04:22:11 +0000 |
commit | 59e104686f63e092d9adf15809bead3d2855af57 (patch) | |
tree | fcab30df8038af19004e285819acb1923da0d528 | |
parent | cf48932e9c614884be015feecb615c4d42f6f135 (diff) | |
download | perl-59e104686f63e092d9adf15809bead3d2855af57.tar.gz |
Re: [perl #24076] "<> err EXPR" and warnings.
Message-Id: <20031005212754.5ef54472.rgarciasuarez@free.fr>
(Applied with tweaks to op.c and a comment.)
p4raw-id: //depot/perl@21406
-rw-r--r-- | op.c | 4 | ||||
-rw-r--r-- | t/lib/warnings/op | 12 |
2 files changed, 15 insertions, 1 deletions
@@ -3351,7 +3351,9 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) return first; } } - else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS)) { + else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS) && + type != OP_DOR) /* [#24076] Don't warn for <FH> err FOO. */ + { OP *k1 = ((UNOP*)first)->op_first; OP *k2 = k1->op_sibling; OPCODE warnop = 0; diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 35779a9f5a..e06d251eaa 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -674,6 +674,18 @@ EXPECT Value of readdir() operator can be "0"; test with defined() at - line 4. ######## # op.c +use warnings 'misc'; +open FH, "<abc"; +$_ = <FH> err $_ = 1; +($_ = <FH>) // ($_ = 1); +opendir DH, "."; +$_ = readdir DH err $_ = 1; +$_ = <*> err $_ = 1; +%a = (1,2,3,4) ; +$_ = each %a err $_ = 1; +EXPECT +######## +# op.c use warnings 'redefine' ; sub fred {} sub fred {} |