From c5b4738f5730e10f2f4200c950adebd5f38bba49 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 2 May 2017 10:44:41 +0200 Subject: [multiple changes] 2017-05-02 Tristan Gingold * s-trasym.ads: Add comment. 2017-05-02 Bob Duff * sem_elab.adb, sem_elab.ads: Minor comment fixes. * sem_ch4.adb: Minor reformatting. * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring. * s-taspri-posix-noaltstack.ads: Minor refactoring. * sinput.ads: Minor typo fix. 2017-05-02 Ed Schonberg * exp_ch9.adb (Discriminated_Size): Moved to sem_util. * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved here from exp_ch9, to recognize objects whose creation requires dynamic allocation, so that the proper warning can be emitted when restriction No_Implicit_Heap_Allocation is in effect. * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size to emit proper warning when an object that requires dynamic allocation is declared. From-SVN: r247472 --- gcc/ada/sem_ch4.adb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'gcc/ada/sem_ch4.adb') diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 9a22b8e..8a94f3f 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -4930,7 +4930,8 @@ package body Sem_Ch4 is if Comp = First_Private_Entity (Type_To_Use) then if Etype (Sel) /= Any_Type then - -- We have a candiate. + -- We have a candiate + exit; else @@ -4993,8 +4994,8 @@ package body Sem_Ch4 is then if Present (Hidden_Comp) then Error_Msg_NE - ("invalid reference to private component of object " - & "of type &", N, Type_To_Use); + ("invalid reference to private component of object of type " + & "&", N, Type_To_Use); else Error_Msg_NE @@ -6476,13 +6477,14 @@ package body Sem_Ch4 is -- Either the types are compatible, or one operand is universal -- (numeric or null). - or else ((In_Instance or else In_Inlined_Body) - and then - (First_Subtype (T1) = First_Subtype (Etype (R)) - or else Nkind (R) = N_Null - or else - (Is_Numeric_Type (T1) - and then Is_Universal_Numeric_Type (Etype (R))))) + or else + ((In_Instance or else In_Inlined_Body) + and then + (First_Subtype (T1) = First_Subtype (Etype (R)) + or else Nkind (R) = N_Null + or else + (Is_Numeric_Type (T1) + and then Is_Universal_Numeric_Type (Etype (R))))) -- In Ada 2005, the equality on anonymous access types is declared -- in Standard, and is always visible. -- cgit v1.1