Ada now supports C++ constructor calls in array aggregates
Adds support for calling C++ constructors within Ada array aggregates.
This commit introduces support for calling C++ constructors within Ada array aggregates. This enhancement allows for more seamless integration between Ada and C++ code, particularly when initializing arrays with objects that require C++-style construction. The change modifies exp_ch5.adb to handle internally generated initializations that invoke C++ constructors.
In Details
Implements support for C++ constructor calls within Ada array aggregates by modifying exp_ch5.adb (Expand_N_Assignment_Statement). This involved handling internally generated initialization sequences that trigger C++ constructor invocations. This enhancement contributes to improved interoperability between Ada and C++.
For Context
Ada array aggregates provide a way to initialize arrays with specific values. C++ uses constructors to initialize objects of a class. This commit bridges a gap between Ada and C++ by enabling the use of C++ constructors when initializing Ada arrays. This means that when an Ada array contains objects that are defined in C++ and require special initialization, the appropriate C++ constructor can now be called. This enhances interoperability between the two languages.