aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-12-09 00:16:19 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-12-09 00:16:19 +0000
commitca0401be06daa21ac731b38698fe3b5af2a9a29d (patch)
tree441d8f4821216943783245fb1095bed5caa6e977
parent1fbbc69cdffb4715ba395e7754d801aebdf992f7 (diff)
downloadgcc-ca0401be06daa21ac731b38698fe3b5af2a9a29d.zip
gcc-ca0401be06daa21ac731b38698fe3b5af2a9a29d.tar.gz
gcc-ca0401be06daa21ac731b38698fe3b5af2a9a29d.tar.bz2
compiler: It's OK to assign a struct with hidden fields in a literal.
From-SVN: r182144
-rw-r--r--gcc/go/gofrontend/expressions.cc12
1 files changed, 0 insertions, 12 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 7314288..e42d178 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -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;
}