carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Be a little more prescriptive about {} initialization in style. #4009

Closed jonmeow closed 1 month ago

jonmeow commented 1 month ago

Following discussions around #3958, try to provide more specific semantics. Note we currently don't follow this everywhere, particularly in AddInst calls, but the intent is to shift. Per discussion, designated initializers are preferred when possible. And the google-readability-casting diagnostics are poor, but with this may primarily flag cases which should be using a different constructor syntax, so are just a rocky way to get there.