aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo-utils.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-06-16 09:16:19 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-07-28 09:28:13 +0200
commit02cda19cc998905dc2319407d7e49a2d48ec9af2 (patch)
treec1f2b857def65cf585b2332fc8d24b0e612e2767 /gcc/ada/einfo-utils.adb
parentcb3bed6018acae828f7a4828678c017c95f695f4 (diff)
downloadgcc-02cda19cc998905dc2319407d7e49a2d48ec9af2.zip
gcc-02cda19cc998905dc2319407d7e49a2d48ec9af2.tar.gz
gcc-02cda19cc998905dc2319407d7e49a2d48ec9af2.tar.bz2
ada: Allow calls to Number_Formals when no formals are present
It is much simpler and safer for the routine Number_Formals to accept subprogram entities that have no formals. gcc/ada/ * einfo-utils.adb (Number_Formals): Change types in body. * einfo-utils.ads (Number_Formals): Change type in spec. * einfo.ads (Number_Formals): Change type in comment. * sem_ch13.adb (Is_Property_Function): Fix style in a caller of Number_Formals that was likely to crash because of missing guards.
Diffstat (limited to 'gcc/ada/einfo-utils.adb')
-rw-r--r--gcc/ada/einfo-utils.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index dad3a65..7fe5171 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -2105,8 +2105,8 @@ package body Einfo.Utils is
-- Number_Formals --
--------------------
- function Number_Formals (Id : E) return Pos is
- N : Int;
+ function Number_Formals (Id : E) return Nat is
+ N : Nat;
Formal : Entity_Id;
begin