From 02cda19cc998905dc2319407d7e49a2d48ec9af2 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Fri, 16 Jun 2023 09:16:19 +0200 Subject: 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. --- gcc/ada/einfo.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/ada/einfo.ads') diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index b356b76..d7690d9 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3832,7 +3832,7 @@ package Einfo is -- Number_Formals (synthesized) -- Applies to subprograms and subprogram types. Yields the number of --- formals as a value of type Pos. +-- formals as a value of type Nat. -- Object_Size_Clause (synthesized) -- Applies to entities for types and subtypes. If an object size clause -- cgit v1.1