Suppress Warning for Quantified Expressions with Filters
The Ada compiler now suppresses a warning about unused variables in quantified expressions when a filter is present.
The Ada compiler now suppresses a warning about unused quantified variables within quantified expressions when a filter is present. The presence of a filter makes it less obvious whether the quantified variable is intentionally unused, thus the warning is suppressed to avoid false positives.
In Details
This commit modifies sem_ch4.adb to suppress the unused variable warning in quantified expressions when a filter is present. The heuristic considers that the filter's complexity may justify an otherwise unused quantified variable.
For Context
The Ada compiler sometimes warns about variables that are declared but never used. In certain complex expressions called "quantified expressions," it can be unclear whether a variable is truly unused or intentionally included for a specific purpose (e.g., in conjunction with a filter). This commit tells the compiler to be less aggressive in issuing this warning for quantified expressions that include a filter.