GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada: Streamline semantic analysis of expression functions

This commit streamlines the implementation of semantic analysis for expression functions in Ada, with no intended functional changes.

This commit focuses on streamlining the implementation of semantic analysis for expression functions in Ada. The changes primarily involve using Subp_Id throughout the code, employing Is_Expression_Function to identify expression functions, and simplifying the implementation of Expression_Of_Expression_Function and Is_Expression_Function. These adjustments aim to improve code maintainability and readability without altering the functionality of the compiler.

In Details

This commit touches files like contracts.adb, ghost.adb, sem_ch12.adb, sem_ch6.adb, sem_ch8.adb, sem_res.adb, and sem_util.adb. The changes focus on the use of Subp_Id and Is_Expression_Function to better identify expression functions during semantic analysis, as well as streamlining the implementations of Expression_Of_Expression_Function and Is_Expression_Function inside sem_util.adb.

For Context

Expression functions in Ada provide a concise way to define functions with a single expression. This commit simplifies the internal workings of the Ada compiler related to how these expression functions are analyzed. The changes make the code cleaner and easier to maintain, but they don't change how expression functions behave from a user's perspective.

Filed Under: adaexpression functionssemantic analysisrefactor