hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.46k stars 238 forks source link

fix: lower (nested) _braced-init-list_ (argument) #927

Open JohelEGP opened 9 months ago

JohelEGP commented 9 months ago

Resolves #1283. Resolves #1037. Resolves #568. Resolves #542.

The main branch already treats a return type contextually, only lowering a braced-init-list if it can work: https://cpp2.godbolt.org/z/sonKE4zan.

This PR recognizes two other places where an expression list can be an initializer to lower as a braced-init-list:

JohelEGP commented 1 week ago

Commit 94bea673583991d2ff90de96a8c4d7a0d312a2b6 did this for the empty list () (non-nested).

hsutter commented 1 week ago

Thanks and sorry for the lag!

This seems like it could be pri-3 (per #1287) if it were rebased to current main. Do you want to rebase this, or should we close this?

JohelEGP commented 2 days ago

Rebased.