diff options
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 3e4c4b332ea..9ed4bc4d54a 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -3285,6 +3285,13 @@ package body Sem_Ch6 is Formal_Type := Etype (Formal); end if; + -- Do not produce extra formals for Unchecked_Union parameters. + -- Jump directly to the end of the loop. + + if Is_Unchecked_Union (Base_Type (Formal_Type)) then + goto Skip_Extra_Formal_Generation; + end if; + if not Has_Discriminants (Formal_Type) and then Ekind (Formal_Type) in Private_Kind and then Present (Underlying_Type (Formal_Type)) @@ -3339,6 +3346,11 @@ package body Sem_Ch6 is Next_Formal (P_Formal); end if; + -- This label is required when skipping extra formal generation for + -- Unchecked_Union parameters. + + <<Skip_Extra_Formal_Generation>> + Next_Formal (Formal); end loop; end Create_Extra_Formals; @@ -5225,6 +5237,7 @@ package body Sem_Ch6 is elsif Is_Record_Type (T) and then Ekind (Formal) = E_In_Parameter and then Chars (Formal) /= Name_uInit + and then not Is_Unchecked_Union (T) and then not Is_Discrim_SO_Function (Subp) then AS_Needed := True; |