Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
spec: clarify meaning of alias decls in sequence of "enum" const declaration #17784
It probably shouldn't be allowed in the first place. Certainly the output is wrong (iota should be incremented with each semicolon).
Currently the spec says iota's value increments after each ConstSpec, and AliasSpec is disjoint from ConstSpec. So I think replacing "d" with "d = iota" would logically assign 2 to d, under the current wording.
That said, if we did want to change it to increment at semicolons, I'm not opposed to that. I just expect in practice it won't really matter. If we choose to increment only after ConstSpecs, users can still include blank ConstSpecs next to AliasSpecs to increment iota; conversely, they can move AliasSpecs out-of-line to prevent them from incrementing iota.