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

Apply check for all primitive equality operations in Ada

The compiler now checks for ghost equality functions in all branches when handling primitive subprograms in Ada.

The compiler now checks for ghost equality functions in all branches when handling primitive subprograms. This improves compile-time checking and potentially prevents subtle errors related to equality comparisons involving primitive types in Ada code.

In Details

This change modifies sem_ch6.adb to include a check for ghost equality functions in all branches of Check_For_Primitive_Subprogram. The Ada frontend uses this procedure to handle primitive subprograms. The commit ensures consistent enforcement of equality checks for primitive types.

For Context

In Ada, a primitive subprogram is a subprogram (function or procedure) that is directly associated with a type. Equality operations define how to compare values of a given type. This commit extends the compiler's checks for 'ghost' equality functions, which are special functions used internally by the compiler, to all code paths that handle primitive subprograms. This change ensures consistent and reliable behavior across different scenarios when comparing Ada types.

Filed Under: adacompilerequality