GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada: Fixes compiler acceptance of illegal constructs in derived types and aggregates.

The Ada compiler now correctly rejects illegal constructs related to renaming inherited subprograms and nonstatic constraints in derived types.

This commit addresses three long-standing bug reports concerning illegal constructs that the Ada compiler was incorrectly accepting. It fixes issues with renaming inherited subprograms of derived untagged types, accepting nonstatic constraints for discriminants of private extension ancestors, and accepting simple aggregates for extension of formal tagged private types. While two of the fixes involve commentary updates to avoid breaking existing code, the third case is fully corrected.

In Details

ada: This commit rectifies several violations of the Ada Reference Manual (RM) identified in bug reports PR ada/18762, PR ada/31417, and PR ada/38330. For PR ada/18762, it ensures that the convention of an inherited subprogram is correctly handled when renaming it in a derived type. For PR ada/31417, it enforces the RM 7.3(13) requirement that constraints on discriminants of private extension ancestors must statically match. For PR ada/38330, it corrects the handling of aggregates for formal tagged private type extensions, now requiring extension aggregates as per the RM.

For Context
subprogram
In Ada, a procedure or function.
derived type
A type that inherits properties from a parent type. In Ada, this can be a record extension, tagged type extension, or other forms of derivation.
tagged type
An Ada type that has a tag, enabling dynamic dispatch and object-oriented features like extension and overriding.
aggregate
A composite value constructed from its components, used to initialize or represent composite types like records or arrays in Ada.
discriminant
A parameter of a generic unit or a variant record that influences its structure or behavior. Variant records use discriminants to determine their size and component layout.
Filed Under: adabugfixcompiler