Bug #1692
closedwarning: useless use of a literal in void context
Description
=begin
1.8 では
warning: useless use of a literal in void context
が出るときに 1.9 だと何も出ません。
% ruby18 -ve '1'
ruby 1.8.8dev (2009-06-23 revision 23825) [i686-linux]
-e:1: warning: useless use of a literal in void context
% ruby-trunk -ve '1'
ruby 1.9.2dev (2009-06-24 trunk 23837) [i686-linux]
%
=end
        
           Updated by matz (Yukihiro Matsumoto) over 16 years ago
          Updated by matz (Yukihiro Matsumoto) over 16 years ago
          
          
        
        
      
      - Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r23864.
=end
        
           Updated by matz (Yukihiro Matsumoto) over 16 years ago
          Updated by matz (Yukihiro Matsumoto) over 16 years ago
          
          
        
        
      
      - Status changed from Closed to Open
=begin
wrong ML ref
=end
        
           Updated by yugui (Yuki Sonoda) over 16 years ago
          Updated by yugui (Yuki Sonoda) over 16 years ago
          
          
        
        
      
      - Assignee set to matz (Yukihiro Matsumoto)
- Target version set to 1.9.2
=begin
意図されたことでしょうか? < まつもとさん
=end
        
           Updated by mame (Yusuke Endoh) over 15 years ago
          Updated by mame (Yusuke Endoh) over 15 years ago
          
          
        
        
      
      - Assignee changed from matz (Yukihiro Matsumoto) to nobu (Nobuyoshi Nakada)
=begin
遠藤です。
r23474 の影響のようで、意図されたことではないと思います。
パッチにはあまり自信ありませんが、なかださんどうでしょうか。
diff --git a/parse.y b/parse.y
index c88a727..cb49fa1 100644
--- a/parse.y
+++ b/parse.y
@@ -785,8 +785,7 @@ static void token_info_pop(struct parser_params*, const char token);
program		:  {
lex_state = EXPR_BEG;
/%%%*/
- 
$<num>$ = compile_for_eval || rb_parse_in_main();
- 
local_push($<num>$);
- 
local_push(compile_for_eval || rb_parse_in_main()); /*% local_push(0); %*/
@@ -794,7 +793,7 @@ program		:  {
top_compstmt
{
/%%%/
- 
if ($2 && !$<num>1) {
- 
if ($2 && !compile_for_eval) { /* last expression should not be void */ if (nd_type($2) != NODE_BLOCK) void_expr($2); else {
--
Yusuke Endoh mame@tsg.ne.jp
=end
        
           Updated by mame (Yusuke Endoh) over 15 years ago
          Updated by mame (Yusuke Endoh) over 15 years ago
          
          
        
        
      
      - Status changed from Open to Closed
=begin
This issue was solved with changeset r27504.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end