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

Ada: Fix error in deep delta array aggregate with others

The compiler no longer attempts an illegal scalar range check on the "others" choice in deep delta array aggregates.

The compiler was trying to apply a scalar range check to the “others” choice in deep delta array aggregates, which is illegal. This commit special-cases the “others” clause to prevent this error during expansion.

In Details

The compiler expands N_Delta_Aggregate nodes during semantic analysis, specifically in exp_spark.adb. Previously, the expansion logic didn't account for the case where an 'others' clause was present, leading to an invalid scalar range check. This patch adds a special case to handle the 'others' clause correctly during expansion.

For Context

Ada allows specifying array aggregates with a "delta". A delta aggregate initializes an array with a specific range of values, and optionally an "others" clause to specify a default value for the remaining indices. This commit fixes an error that could occur when using a "delta aggregate" with an "others" clause. The compiler was attempting to perform an invalid range check on the "others" clause, which is not allowed.

Filed Under: adacompilerbugfix