fix(cpp1): account for initializers of members lowered as bases
Resolves #422.
Testing summary.
100% tests passed, 0 tests failed out of 704
Total Test time (real) = 104.69 sec
Acknowledgements.
- Tested thanks to https://github.com/modern-cmake/cppfront.
- The commit message uses Conventional Commits 1.0.0.
With commit 379ae0311f177ea42517cb07520c4f804f4396b6, a
@structlowers to an aggregate. If an@structtype also has members lowered as bases, it's necessary to continue emitting those SMFs. -- https://github.com/hsutter/cppfront/issues/422#issuecomment-1595827494
I suppose the only reasonable option is to queue an error if emitting SMFs is suppressed.
I can't reliably lower an initializer to the *_as_base's data member's initializer,
as it could only be valid in the derived type's scope
(e.g., uses the type's template parameter or a previous data member).
I thought about also emitting actual bases to *_as_struct_base,
but besides being equally problematic to move the lowered initializer,
the change from a direct base class to an indirect one should come with its own set of problems.
I wonder if the error falls under the banner of "(temporary alpha limitation)".
Hi! Sorry it took me so long to get to this one... this one looks like it might be out of date, should I close it for now and you can reopen this or create a new PR when it's ready? Again, my apologies for not keeping up.