From a8a42b933c5dc135080120d0a1d115c602a328fb Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 16 Jun 2016 11:52:17 +0200 Subject: [multiple changes] 2016-06-16 Javier Miranda * sem_res.adb (Resolve): Under relaxed RM semantics silently replace occurrences of null by System.Null_Address. * sem_ch4.adb (Analyze_One_Call, Operator_Check): Under relaxed RM semantics silently replace occurrences of null by System.Null_Address. * sem_util.ad[sb] (Null_To_Null_Address_Convert_OK): New subprogram. (Replace_Null_By_Null_Address): New subprogram. 2016-06-16 Bob Duff * exp_util.adb (Is_Controlled_Function_Call): This was missing the case where the call is in prefix format, with named notation, as in Obj.Func (Formal => Actual). From-SVN: r237508 --- gcc/ada/sem_ch4.adb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gcc/ada/sem_ch4.adb') diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index a109cd0..66a2acf 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -3397,6 +3397,18 @@ package body Sem_Ch4 is Next_Actual (Actual); Next_Formal (Formal); + -- Under relaxed RM semantics silently replace occurrences of + -- null by System.Address_Null. We only do this if we know that + -- an error will otherwise be issued. + + elsif Null_To_Null_Address_Convert_OK (Actual, Etype (Formal)) + and then (Report and not Is_Indexed and not Is_Indirect) + then + Replace_Null_By_Null_Address (Actual); + Analyze_And_Resolve (Actual, Etype (Formal)); + Next_Actual (Actual); + Next_Formal (Formal); + -- For an Ada 2012 predicate or invariant, a call may mention -- an incomplete type, while resolution of the corresponding -- predicate function may see the full view, as a consequence @@ -6806,6 +6818,20 @@ package body Sem_Ch4 is return; end; + + -- Under relaxed RM semantics silently replace occurrences of + -- null by System.Address_Null. + + elsif Null_To_Null_Address_Convert_OK (N) then + Replace_Null_By_Null_Address (N); + + if Nkind_In (N, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt) then + Analyze_Comparison_Op (N); + else + Analyze_Arithmetic_Op (N); + end if; + + return; end if; -- Comparisons on A'Access are common enough to deserve a @@ -6875,6 +6901,14 @@ package body Sem_Ch4 is Unchecked_Convert_To (Etype (L), Relocate_Node (R))); Analyze_Equality_Op (N); return; + + -- Under relaxed RM semantics silently replace occurrences of + -- null by System.Address_Null. + + elsif Null_To_Null_Address_Convert_OK (N) then + Replace_Null_By_Null_Address (N); + Analyze_Equality_Op (N); + return; end if; end if; -- cgit v1.1