diff --git a/doc/go_spec.html b/doc/go_spec.html index 8643d94476..2832b0739d 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -642,7 +642,7 @@ an identifier denoting a constant, a constant expression, a conversion with a result that is a constant, or the result value of some built-in functions such as -unsafe.Sizeof applied to any value, +unsafe.Sizeof applied to certain values, cap or len applied to some expressions, real and imag applied to a complex constant @@ -7446,8 +7446,14 @@ uintptr(unsafe.Pointer(&x)) % unsafe.Alignof(x) == 0

-Calls to Alignof, Offsetof, and -Sizeof are compile-time constant expressions of type uintptr. +A (variable of) type T has variable size if T +is a type parameter, or if it is an array or struct type containing elements +or fields of variable size. Otherwise the size is constant. +Calls to Alignof, Offsetof, and Sizeof +are compile-time constant expressions of +type uintptr if their arguments (or the struct s in +the selector expression s.f for Offsetof) are types +of constant size.