Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: b2bbe7d8e2b196d341cd8c3e1d3b7600b81c1a41
      
https://github.com/Perl/perl5/commit/b2bbe7d8e2b196d341cd8c3e1d3b7600b81c1a41
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M lib/B/Deparse.t
    M op.c
    M pod/perldiag.pod
    M t/lib/warnings/op

  Log Message:
  -----------
  elide right operand if left operand transfers control

This commit contains the following changes:

- The "possible precedence issue" warning now mentions (in parentheses)
  the name of the control flow operator that triggered the warning:

      $ ./perl -cwe 'return $a or $b'
      Possible precedence issue with control flow operator (return) at -e line 
1.

- CORE::dump now counts as a control flow operator:

      $ ./perl -cwe 'CORE::dump or f()'
      Possible precedence issue with control flow operator (dump) at -e line 1.

- Any binary operator whose left operand is a control flow operator is
  optimized out along with any right operand it may have, even if no
  warning is triggered:

      $ ./perl -Ilib -MO=Deparse -we '(die $a) + $b'
      BEGIN { $^W = 1; }
      die $a;
      -e syntax OK

  (No warnings because explicit parentheses are used in the preceding
  example.)

      $ ./perl -Ilib -MO=Deparse -we 'exit $a ? 0 : 1'
      Possible precedence issue with control flow operator (exit) at -e line 1.
      BEGIN { $^W = 1; }
      exit $a;
      -e syntax OK


Reply via email to