GDCC icon indicating copy to clipboard operation
GDCC copied to clipboard

Improved compound literal handling

Open DavidPH opened this issue 6 years ago • 0 comments

Currently, compound literals work by generating an object, then making a *(obj = init, &obj) expression with it. This has several unfortunate consequences. Particularly the fact that it takes the object's address, meaning that it has to have automatic storage even if the compound literal's address is not otherwise used. It also means that it initializes an object even when it is only used for its value. The solution is, I think, to have a dedicated compound literal expression class that can defer object creation.

DavidPH avatar Jul 20 '18 17:07 DavidPH