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

Ada: Remove useless call to Can_Have_Formals.

Removes a useless call to `Can_Have_Formals` in `Is_Access_To_Subprogram_Wrapper` to fix an incorrect error message.

A call to Can_Have_Formals within Is_Access_To_Subprogram_Wrapper was found to be unnecessary. This commit removes it, resolving an issue where an incorrect error message was being displayed due to this redundant check. This simplifies the code and ensures more accurate error reporting.

In Details

sem_util.adb contains semantic analysis utilities for Ada. Is_Access_To_Subprogram_Wrapper likely checks whether a given construct is an access-to-subprogram wrapper. Can_Have_Formals probably checks if a subprogram can have formal parameters. The commit removes a call to Can_Have_Formals within Is_Access_To_Subprogram_Wrapper.

For Context

The Ada compiler performs semantic analysis to ensure the code is well-formed. This involves checking various properties of the code, such as whether a subprogram can have formal parameters. This commit removes a redundant check during semantic analysis, ensuring more accurate error reporting in certain cases.

Filed Under: adasemantic analysisbugfix