case OP_GVSV:
case OP_WANTARRAY:
case OP_GV:
+ case OP_SMARTMATCH:
case OP_PADSV:
case OP_PADAV:
case OP_PADHV:
case OP_ANONLIST:
case OP_ANONHASH:
case OP_SORT:
+ case OP_GREPWHILE:
case OP_REVERSE:
case OP_RANGE:
case OP_FLIP:
case OP_PROTOTYPE:
func_ops:
if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO)))
- useless = OP_DESC(o);
+ /* Otherwise it's "Useless use of grep iterator" */
+ useless = (o->op_type == OP_GREPWHILE) ? "grep"
+ : OP_DESC(o);
break;
case OP_NOT:
eval { getpwnam 1 }; # OP_GPWNAM
eval { getpwuid 1 }; # OP_GPWUID
prototype "foo"; # OP_PROTOTYPE
+grep /42/, (1,2); # OP_GREP
+$a ~~ $b; # OP_SMARTMATCH
+$a <=> $b; # OP_NCMP
EXPECT
Useless use of repeat (x) in void context at - line 3.
Useless use of wantarray in void context at - line 5.
Useless use of getpwnam in void context at - line 52.
Useless use of getpwuid in void context at - line 53.
Useless use of subroutine prototype in void context at - line 54.
+Useless use of grep in void context at - line 55.
+Useless use of smart match in void context at - line 56.
+Useless use of numeric comparison (<=>) in void context at - line 57.
########
# op.c
use warnings 'void' ; close STDIN ;