Ada: Fix constrained-vs-definite confusion
Corrected a legality check in Ada to properly distinguish between constrained and definite types.
This patch corrects a legality check within the Ada front-end by replacing a test for ‘constrainedness’ with a more accurate test for ‘definiteness’. This change aligns the code with the relevant Ada Reference Manual clause and ensures that type properties are checked correctly, resolving potential issues with how constrained and definite types are handled.
In Details
The change in ada/sem_ch3.adb's Process_Full_View replaces a check for constrained_type_p with one for definite_type_p. This is a correctness fix for Ada's legality checking, ensuring that the compiler correctly distinguishes between types that have a fixed size/representation (constrained) and types that have a determined value (definite). This distinction is important for various language constructs and storage-related analyses.
- Ada
- A structured, statically typed, imperative programming language with a design emphasizing safety and the ability to handle large, long-lived applications.
- legality check
- A check performed by the compiler to ensure that a piece of code conforms to the language's grammatical and semantic rules.
- constrained type
- In Ada, a type whose range or structure is fixed and cannot vary.
- definite type
- In Ada, a type whose value is determined and known.
- Ada RM
- Ada Reference Manual. The official specification document for the Ada programming language.