]> Cypherpunks repositories - gostls13.git/commitdiff
spec: clarify language about unary operator &
authorRobert Griesemer <gri@golang.org>
Thu, 3 Jan 2013 02:11:49 +0000 (18:11 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 3 Jan 2013 02:11:49 +0000 (18:11 -0800)
A composite literal may be parenthesized when
used as operand for the unary operator &.

R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/6996053

doc/go_spec.html

index 0087d8b5ecd04664bddfbfaca88dc72fd5bbf8dc..ad3fa519b2ec24ae9b92bb3cf6465a8eb36f48f0 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of December 12, 2012",
+       "Subtitle": "Version of January 2, 2013",
        "Path": "/ref/spec"
 }-->
 
@@ -3246,6 +3246,7 @@ that is, either a variable, pointer indirection, or slice indexing
 operation; or a field selector of an addressable struct operand;
 or an array indexing operation of an addressable array.
 As an exception to the addressability requirement, <code>x</code> may also be a
+(possibly parenthesized)
 <a href="#Composite_literals">composite literal</a>.
 </p>
 <p>
@@ -3259,6 +3260,7 @@ will cause a <a href="#Run_time_panics">run-time panic</a>.
 <pre>
 &amp;x
 &amp;a[f(2)]
+&amp;Point{2, 3}
 *p
 *pf(x)
 </pre>