• Robert Griesemer's avatar
    spec: clarify restrictions on RHS of non-constant shifts · e4ce08af
    Robert Griesemer authored
    For non-constant shifts with an untyped constant shift count, the
    spec only said that it must "be converted to unsigned integer type".
    go/types accepts any (arbitrarily large) integer value. Both cmd/compile
    and gccgo require that the shift count be representable as a uint value
    in that case (if the shift count is typed, it may be any unsigned integer
    type).
    
    This change adjusts the spec to state what the compilers have been doing
    all along. The new wording matches similar rules elsewhere (e.g., for
    untyped array and slice indices). Also, while technically this is a
    restriction (we could permit arbitrarily large shift counts), in practice
    this is irrelevant.
    
    Fixes #14822.
    
    Change-Id: Ia75834c67483cf761c10025c8df758f225ef67c2
    Reviewed-on: https://go-review.googlesource.com/45072Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    e4ce08af
Name
Last commit
Last update
..
articles Loading commit data...
codewalk Loading commit data...
devel Loading commit data...
gopher Loading commit data...
play Loading commit data...
progs Loading commit data...
asm.html Loading commit data...
cmd.html Loading commit data...
code.html Loading commit data...
conduct.html Loading commit data...
contrib.html Loading commit data...
contribute.html Loading commit data...
debugging_with_gdb.html Loading commit data...
docs.html Loading commit data...
effective_go.html Loading commit data...
gccgo_contribute.html Loading commit data...
gccgo_install.html Loading commit data...
go-logo-black.png Loading commit data...
go-logo-blue.png Loading commit data...
go-logo-white.png Loading commit data...
go1.1.html Loading commit data...
go1.2.html Loading commit data...
go1.3.html Loading commit data...
go1.4.html Loading commit data...
go1.5.html Loading commit data...
go1.6.html Loading commit data...
go1.7.html Loading commit data...
go1.8.html Loading commit data...
go1.9.html Loading commit data...
go1.html Loading commit data...
go1compat.html Loading commit data...
go_faq.html Loading commit data...
go_mem.html Loading commit data...
go_spec.html Loading commit data...
help.html Loading commit data...
ie.css Loading commit data...
install-source.html Loading commit data...
install.html Loading commit data...
root.html Loading commit data...
security.html Loading commit data...
share.png Loading commit data...
tos.html Loading commit data...