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

Ada: Freezing change for expression functions requires fix

Reverts part of a change that unnecessarily prevented the profile of dispatching operations from being frozen by their subprogram body.

A recent change to freeze tagged types referenced in expression functions had unintended side effects. The change prevented the profile of all dispatching operations from being frozen by their subprogram body, which exposed a weakness in the implementation of freezing for generic units. This commit reverts that specific part of the freezing change to address the issue.

In Details

Fixes a regression introduced by recent changes to freezing logic, specifically how expression functions interact with type freezing in generic units. The original change in exp_ch3.adb (Make_Controlling_Function_Wrappers) is reverted, along with adjustments to sem_ch12.adb and sem_ch6.adb to restore the intended freezing behavior.

For Context

Ada requires that types be 'frozen' before code can be generated for them, meaning their characteristics are fixed. Expression functions, introduced in Ada 2012, can trigger this freezing. This commit addresses a problem where a recent change in how expression functions freeze types was interfering with the freezing of dispatching operations in generic units, causing issues during code generation. It essentially undoes a portion of the problematic change to restore the correct behavior.

Filed Under: adacompilerbugfix