diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-06-24 09:57:53 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-15 05:39:12 -0400 |
commit | 8f366ea4dbe44407ad3f6af2a4a23c9fb007aea3 (patch) | |
tree | d8b257d31bc22281a37cd9632ebf69ecff758baf /gcc/ada/sem_ch3.adb | |
parent | 1d1e5e2e2cd122e4836f05072dbe430a451870fd (diff) | |
download | gcc-8f366ea4dbe44407ad3f6af2a4a23c9fb007aea3.zip gcc-8f366ea4dbe44407ad3f6af2a4a23c9fb007aea3.tar.gz gcc-8f366ea4dbe44407ad3f6af2a4a23c9fb007aea3.tar.bz2 |
[Ada] Bring defensive guard for Null_Exclusion_Present up to date
gcc/ada/
* sem_ch3.adb (Process_Subtype): Sync May_Have_Null_Exclusion
with assertion in Null_Exclusion_Present; clarify the scope of
local variables.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 63779e8..9232d49 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -21487,14 +21487,6 @@ package body Sem_Ch3 is Related_Id : Entity_Id := Empty; Suffix : Character := ' ') return Entity_Id is - P : Node_Id; - Def_Id : Entity_Id; - Error_Node : Node_Id; - Full_View_Id : Entity_Id; - Subtype_Mark_Id : Entity_Id; - - May_Have_Null_Exclusion : Boolean; - procedure Check_Incomplete (T : Node_Id); -- Called to verify that an incomplete type is not used prematurely @@ -21519,6 +21511,16 @@ package body Sem_Ch3 is end if; end Check_Incomplete; + -- Local variables + + P : Node_Id; + Def_Id : Entity_Id; + Error_Node : Node_Id; + Full_View_Id : Entity_Id; + Subtype_Mark_Id : Entity_Id; + + May_Have_Null_Exclusion : Boolean; + -- Start of processing for Process_Subtype begin @@ -21550,7 +21552,8 @@ package body Sem_Ch3 is Error_Msg_N ("`NOT NULL` only allowed for an access type", S); end if; - -- The following is ugly, can't we have a range or even a flag??? + -- The following mirroring of assertion in Null_Exclusion_Present is + -- ugly, can't we have a range, a static predicate or even a flag??? May_Have_Null_Exclusion := Nkind (P) in N_Access_Definition @@ -21562,6 +21565,7 @@ package body Sem_Ch3 is | N_Derived_Type_Definition | N_Discriminant_Specification | N_Formal_Object_Declaration + | N_Function_Specification | N_Object_Declaration | N_Object_Renaming_Declaration | N_Parameter_Specification |