summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch8.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 12:53:29 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 12:53:29 +0200
commitdb222eadb159ec04d1e7884c701e61e99e7e37c2 (patch)
treea3702aa892b5542204a4faac178e2222cf39d084 /gcc/ada/sem_ch8.adb
parenta2f45fe669c9e45901114e88b27327f06a138c32 (diff)
downloadgcc-db222eadb159ec04d1e7884c701e61e99e7e37c2.tar.gz
[multiple changes]
2015-05-22 Robert Dewar <dewar@adacore.com> * sem_ch8.adb (Analyze_Object_Renaming): Check for renaming component of an object to which Volatile_Full_Access applies. 2015-05-22 Jerome Guitton <guitton@adacore.com> * exp_dbug.ads: Add note about non bit-packed arrays. 2015-05-22 Eric Botcazou <ebotcazou@adacore.com> * sem_prag.adb: Fix typo. * einfo.ads: Grammar fixes in comments. 2015-05-22 Bob Duff <duff@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sem_ch8.adb')
-rw-r--r--gcc/ada/sem_ch8.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index d3784f8589c..20ec73aeb80 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,