Ada Accepts Formal Function Defaults with -gnatX Core Extensions.
The Ada compiler now allows default values for formal functions when using core extensions (-gnatX).
The Ada compiler now correctly allows formal functions to be defaulted by an expression when core extensions are enabled using the -gnatX flag. Previously, the compiler incorrectly required all extensions to be enabled, which was stricter than intended. The fix modifies par-ch12.adb to pass True for the Is_Core_Extension parameter when calling Error_Msg_GNAT_Extension.
In Details
The Ada compiler's parser component (par-ch12.adb) handles the declaration of formal subprograms (generic parameters that are subprograms). The -gnatX flag enables GNAT extensions to the Ada language. This commit corrects an error in the handling of default values for formal subprograms when core GNAT extensions are enabled, ensuring that the compiler adheres to the intended language semantics.
For Context
Ada allows specifying default values for parameters in subprograms (functions and procedures). When using extensions to the core Ada language (enabled via the -gnatX flag), this commit corrects an issue where default values for function parameters were incorrectly rejected. This ensures that the compiler correctly implements the extended language features.