Closed MaxSagebaum closed 2 days ago
This could be fixed by generating the appropriate constructor. That is a constructor with as many arguments as member in the order of the members.
Thanks! I ran into this in cppfront's own code, notably in the parse.h types, where I had to do the same thing -- write out the constructor. It also happened only in newer/stricter compilers. For aggregates, my untested suspicion is that the problem might go away on its own once the rule change for ()
aggregate initialization is implemented, but there's no reason not to fix it in the meantime anyway...
Oh wait, I forgot to re-run regression, still have bugs to fix...
Now actually fixed...
Describe the bug While using clang-15 a structure created with
@struct
can not be initialized with values while using clang-15.This does not seem to be a problem in gcc-10 and upwards.
To Reproduce On compiler explorer: https://cpp2.godbolt.org/z/Me86GzYE8
Error:
Variants
@struct
: https://cpp2.godbolt.org/z/rWr1s6b8d