Skip to content

Commit 54cc682

Browse files
ronan-dMarc Poulhiès
authored andcommitted
ada: Update comments
A previous patch changed the mechanism of early usage detection for discriminants but failed to update a couple of surrounding comments accordingly. This patch fixes this omission. gcc/ada/ChangeLog: * sem_ch3.adb (Process_Discriminants): Update comments
1 parent a999dc3 commit 54cc682

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gcc/ada/sem_ch3.adb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21295,8 +21295,8 @@ package body Sem_Ch3 is
2129521295
-- On entry, the current scope is the composite type.
2129621296

2129721297
-- The discriminants are initially entered into the scope of the type
21298-
-- via Enter_Name with the default Ekind of E_Void to prevent premature
21299-
-- use, as explained at the end of this procedure.
21298+
-- via Enter_Name with Is_Not_Self_Hidden set to False to prevent
21299+
-- premature use, as explained at the end of this procedure.
2130021300

2130121301
Discr := First (Discriminant_Specifications (N));
2130221302
while Present (Discr) loop
@@ -21569,12 +21569,12 @@ package body Sem_Ch3 is
2156921569
-- expressions of a discriminant part if the specification of the
2157021570
-- discriminant is itself given in the discriminant part. (RM 3.7.1)
2157121571

21572-
-- To detect this, the discriminant names are entered initially with an
21573-
-- Ekind of E_Void (which is the default Ekind given by Enter_Name). Any
21574-
-- attempt to use a void entity (for example in an expression that is
21575-
-- type-checked) produces the error message: premature usage. Now after
21576-
-- completing the semantic analysis of the discriminant part, we can set
21577-
-- the Ekind of all the discriminants appropriately.
21572+
-- To detect this, the discriminant names are entered initially with
21573+
-- Is_Not_Self_Hidden set to False. Any attempt to use a self-hidden
21574+
-- entity (for example in an expression that is type-checked) produces
21575+
-- the error message: premature usage. Now after completing the semantic
21576+
-- analysis of the discriminant part, we can set Is_Not_Self_Hidden on
21577+
-- all the discriminants appropriately.
2157821578

2157921579
Discr := First (Discriminant_Specifications (N));
2158021580
Discr_Number := Uint_1;

0 commit comments

Comments
 (0)