re PR go/61273 (gccgo: ICE in Unsafe_type_conversion_expression::do_get_backend ...
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 16 Dec 2014 18:53:46 +0000 (18:53 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 16 Dec 2014 18:53:46 +0000 (18:53 +0000)
PR go/61273
compiler: Send statements should contextually permit composite literals.

From-SVN: r218788

gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/parse.h

index 3b5ede542a5dd97bd91e0593bfd8d42921603c6a..a98dd479eb55902367ecbda23df25d03cb74f879 100644 (file)
@@ -3819,7 +3819,7 @@ Parse::simple_stat(bool may_be_composite_lit, bool* return_exp,
   token = this->peek_token();
   if (token->is_op(OPERATOR_CHANOP))
     {
-      this->send_stmt(this->verify_not_sink(exp));
+      this->send_stmt(this->verify_not_sink(exp), may_be_composite_lit);
       if (return_exp != NULL)
        *return_exp = true;
     }
@@ -3913,13 +3913,13 @@ Parse::expression_stat(Expression* exp)
 // Channel  = Expression .
 
 void
-Parse::send_stmt(Expression* channel)
+Parse::send_stmt(Expression* channel, bool may_be_composite_lit)
 {
   go_assert(this->peek_token()->is_op(OPERATOR_CHANOP));
   Location loc = this->location();
   this->advance_token();
-  Expression* val = this->expression(PRECEDENCE_NORMAL, false, true, NULL,
-                                    NULL);
+  Expression* val = this->expression(PRECEDENCE_NORMAL, false,
+                                    may_be_composite_lit, NULL, NULL);
   Statement* s = Statement::make_send_statement(channel, val, loc);
   this->gogo_->add_statement(s);
 }
index 3749645ebb3dbc433fdcfd9d87d2e7de11c05826..d55798b682520e7393f4707cd3b44df1162798dc 100644 (file)
@@ -245,7 +245,7 @@ class Parse
   void statement_list();
   bool statement_list_may_start_here();
   void expression_stat(Expression*);
-  void send_stmt(Expression*);
+  void send_stmt(Expression*, bool may_be_composite_lit);
   void inc_dec_stat(Expression*);
   void assignment(Expression*, bool may_be_composite_lit, Range_clause*);
   void tuple_assignment(Expression_list*, bool may_be_composite_lit,