Ada compiler no longer hangs on structural generic instantiation in expression functions.
Fixes a compiler hang that occurred during implicit instantiation of structural generics within expression functions.
A compiler hang in GCC’s Ada front-end has been resolved. The issue occurred when the first reference to a structural generic instance appeared within an expression function. This commit ensures that the implicit instantiation process happens in an appropriate semantic analysis state, preventing the hang.
In Details
The semantic analyzer in GCC's Ada front-end can hang when processing structural generic instantiations if the first reference occurs within an expression function. This is due to the implicit instantiation not being performed in a suitable semantic state. The Analyze_Structural_Associations procedure in sem_ch12.adb is modified to guarantee correct state management for implicit instantiation, even in local contexts, thereby resolving the hang.
- structural generic instantiation
- In Ada, the process of creating a specific type or subprogram from a generic template based on the structure of another existing type or subprogram, rather than explicit parameter mapping.
- expression function
- A function in Ada that is used within an expression, typically returning a value that can be directly used in computations or assignments.
- semantic analyzer
- A phase of the compiler that checks the meaning and consistency of the program's structure according to the language's rules, after the syntax has been parsed.