From db222eadb159ec04d1e7884c701e61e99e7e37c2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 22 May 2015 12:53:29 +0200 Subject: [multiple changes] 2015-05-22 Robert Dewar * sem_ch8.adb (Analyze_Object_Renaming): Check for renaming component of an object to which Volatile_Full_Access applies. 2015-05-22 Jerome Guitton * exp_dbug.ads: Add note about non bit-packed arrays. 2015-05-22 Eric Botcazou * sem_prag.adb: Fix typo. * einfo.ads: Grammar fixes in comments. 2015-05-22 Bob Duff * a-cborma.ads, a-cidlli.ads, a-cimutr.ads, a-ciormu.ads, * a-cihase.ads, a-cohama.ads, a-coorse.ads, a-cbhama.ads, * a-cborse.ads, a-comutr.ads, a-ciorma.ads, a-cobove.ads, * a-coormu.ads, a-convec.ads, a-cohase.ads, a-coinho.ads, * a-cbdlli.ads, a-cbmutr.ads, a-cbhase.ads, a-cdlili.ads, * a-cihama.ads, a-coinve.ads, a-ciorse.ads, a-coorma.ads, * a-coinho-shared.ads (Constant_Reference_Type, Reference_Type): Add an initialization expression "raise Program_Error". See, for example, RM-A.18.2(148.4). From-SVN: r223548 --- gcc/ada/sem_ch8.adb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/ada/sem_ch8.adb') diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index d3784f8..20ec73a 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -912,6 +912,25 @@ package body Sem_Ch8 is ("renaming of conversion only allowed for tagged types", Nam); end if; + -- Reject renaming of component of Volatile_Full_Access object + + if Nkind_In (Nam, N_Selected_Component, N_Indexed_Component) then + declare + P : constant Node_Id := Prefix (Nam); + begin + if Is_Entity_Name (P) then + if Has_Volatile_Full_Access (Entity (P)) + or else + Has_Volatile_Full_Access (Etype (P)) + then + Error_Msg_N + ("cannot rename component of Volatile_Full_Access " + & "object", Nam); + end if; + end if; + end; + end if; + Resolve (Nam, T); -- If the renamed object is a function call of a limited type, -- cgit v1.1