aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2021-11-16 16:56:44 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-12-01 10:24:43 +0000
commit38e7e9ac1591ca3e7b3adc181a0786fd71739b40 (patch)
treec4533bba0912690a6e88865edb94e81a9e8c4d60 /gcc/fold-const.c
parentbbafa6251ed34c3753d3efd821338b493cc957e0 (diff)
downloadgcc-38e7e9ac1591ca3e7b3adc181a0786fd71739b40.zip
gcc-38e7e9ac1591ca3e7b3adc181a0786fd71739b40.tar.gz
gcc-38e7e9ac1591ca3e7b3adc181a0786fd71739b40.tar.bz2
[Ada] Allow formal functions to have a default in the form of an expression function
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation of the new form of formal subprogram default in the section on language extensions (pragma Extensions_Allowed). * gnat_rm.texi: Regenerate. * gen_il-gen-gen_nodes.adb: Add Expression as a syntactic field of N_Formal_(Abstract|Concrete)_Subprogram_Declaration nodes. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing support for the new default of a parenthesized expression for formal functions. Issue an error when extensions are not allowed, suggesting use of -gnatX. Update comment with extended syntax for SUBPROGRAM_DEFAULT. * sem_ch12.adb (Analyze_Formal_Subprogram_Declaration): Issue an error when an expression default is given for an abstract formal function. When a default expression is present for a formal function, install the function's formals and preanalyze the expression. (Instantiate_Formal_Subprogram): Fix typo in RM paragraph in a comment. When a formal function has a default expression, create a body for the function that will evaluate the expression and will be called when the default applies in an instantiation. The implicit function is marked as inlined and as having convention Intrinsic.
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions