Ada: Fix fallout from change to Analyze_Subprogram_Renaming
Corrects an issue caused by replacing an expression with its Original_Node in subprogram renaming analysis.
A recent change to replace an expression with its Original_Node during subprogram renaming analysis introduced a regression. This commit fixes this issue by manually retrieving the expression of the expression function again in sem_ch8.adb, ensuring that the correct expression is used during analysis.
In Details
This commit addresses a fallout from a recent change related to Analyze_Subprogram_Renaming in sem_ch8.adb. Replacing the original expression with Expression_Of_Expression_Function was not fully equivalent because Expression_Of_Expression_Function returns the Original_Node of the expression. The fix involves retrieving the expression manually to ensure correct analysis.
For Context
Subprogram renaming in Ada allows you to give a new name to an existing subprogram. Expression functions are functions whose body is a single expression. This commit fixes an issue that arose during the analysis of subprogram renaming when dealing with expression functions. A recent change caused the compiler to use the wrong expression in certain cases, leading to incorrect analysis. This commit corrects this by ensuring the correct expression is used.