OSDN Git Service

compiler: It's OK to assign a struct with hidden fields in a literal.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Dec 2011 00:16:19 +0000 (00:16 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Dec 2011 00:16:19 +0000 (00:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182144 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 7314288..e42d178 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;
     }