compiler: It's OK to assign a struct with hidden fields in a literal.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 9 Dec 2011 00:16:19 +0000 (00:16 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 9 Dec 2011 00:16:19 +0000 (00:16 +0000)
From-SVN: r182144

gcc/go/gofrontend/expressions.cc

index 7314288aa4883fb32b0ee7293c92e5a5e670e39a..e42d1787b44c834589e0f07c165437e80217ea7a 100644 (file)
@@ -12986,18 +12986,6 @@ Composite_literal_expression::lower_struct(Gogo* gogo, Type* type)
                 "assignment of unexported field %qs in %qs literal",
                 Gogo::message_name(sf->field_name()).c_str(),
                 type->named_type()->message_name().c_str());
-      else
-       {
-         std::string reason;
-         if (sf->type()->has_hidden_fields(NULL, &reason))
-           {
-             if (reason.empty())
-               error_at(name_expr->location(),
-                        "implicit assignment of hidden field");
-             else
-               error_at(name_expr->location(), "%s", reason.c_str());
-           }
-       }
 
       vals[index] = val;
     }