File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2234,6 +2234,7 @@ Perl_scalarvoid(pTHX_ OP *arg)
2234
2234
case OP_GETLOGIN:
2235
2235
case OP_PROTOTYPE:
2236
2236
case OP_RUNCV:
2237
+ case OP_CMPCHAIN_AND:
2237
2238
func_ops:
2238
2239
if ( (PL_opargs[o->op_type] & OA_TARGLEX)
2239
2240
&& (o->op_private & OPpTARGET_MY)
Original file line number Diff line number Diff line change @@ -238,6 +238,12 @@ negation (C<!!>) is used as a convert-to-boolean operator.
238
238
239
239
=item *
240
240
241
+ L<Useless use of %s in void context|perldiag/"Useless use of %s in void context">
242
+
243
+ This warning now triggers for use of a chained comparison like C<< 0 < $x < 1 >>.
244
+
245
+ =item *
246
+
241
247
XXX Describe change here
242
248
243
249
=back
Original file line number Diff line number Diff line change @@ -422,10 +422,12 @@ $a <=> $b; # OP_NCMP
422
422
"dsatrewq";
423
423
"diatrewq";
424
424
"igatrewq";
425
+ 0 <= $a; # OP_LE
425
426
use 5.015;
426
427
__SUB__ ; # OP_RUNCV
427
428
[]; # OP_ANONLIST
428
429
grep /42/, (1,2); # OP_GREP. Not warned about (yet). Grep git logs for void_unusual to see why...
430
+ 0 <= $a < 10; # OP_CMPCHAIN_AND
429
431
EXPECT
430
432
Useless use of a constant ("111") in void context at - line 2.
431
433
Useless use of repeat (x) in void context at - line 3.
@@ -470,8 +472,10 @@ Useless use of numeric comparison (<=>) in void context at - line 55.
470
472
Useless use of a constant ("dsatrewq") in void context at - line 56.
471
473
Useless use of a constant ("diatrewq") in void context at - line 57.
472
474
Useless use of a constant ("igatrewq") in void context at - line 58.
473
- Useless use of __SUB__ in void context at - line 60.
474
- Useless use of anonymous array ([]) in void context at - line 61.
475
+ Useless use of numeric le (<=) in void context at - line 59.
476
+ Useless use of __SUB__ in void context at - line 61.
477
+ Useless use of anonymous array ([]) in void context at - line 62.
478
+ Useless use of comparison chaining in void context at - line 64.
475
479
########
476
480
# op.c
477
481
use warnings 'scalar' ; close STDIN ;
You can’t perform that action at this time.
0 commit comments