mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fixes #5186 With @zygoloid's kind assistance, this generalizes the existing non-const lowering of ClassInit, that had previously only handled InitializeFrom, to find other cases - such as a nested ClassInit used to initialize a class member. This refactors the `FindReturnSlotArgForInitializer` from `check/convert.cpp` into `sem_ir/file.{h,cpp}` for use from lowering (since lower doesn't depend on check, which I assume is an intentional layering constraint - so figured it made sense to move it to sem_ir, and found one or two similar-ish utility functions in `sem_ir/file.{h,cpp}`, so figured that was a good spot)