diff mbox

Go patch committed: Fix hidden field code

Message ID mcrd3bya9be.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 9, 2011, 12:16 a.m. UTC
Further testing revealed that I goofed on the hidden field patch I just
committed, and was too aggressive on testing for assignments to hidden
fields in composite literals.  It is OK to assign to a type which itself
contains hidden fields in a composite literal; that is just an example
of assignment, which is now permitted.  This patch fixes that.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r c5598ae02285 go/expressions.cc
--- a/go/expressions.cc	Thu Dec 08 15:25:25 2011 -0800
+++ b/go/expressions.cc	Thu Dec 08 16:06:29 2011 -0800
@@ -12986,18 +12986,6 @@ 
 		 "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;
     }