From 3b821fe9fe8ba49149509f4f7bea6353602ad2d2 Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Tue, 18 Feb 2014 11:54:13 +0000 Subject: [PATCH] sem_aux.adb (Is_By_Reference_Type): For each components of a record type... 2014-02-18 Vincent Celier * sem_aux.adb (Is_By_Reference_Type): For each components of a record type, check also if the component is volatile as it may have an aspect that makes it volatile. If it is, then the record type is a by reference type. From-SVN: r207842 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/sem_aux.adb | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4f71051439e..aed187cda97 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2014-02-18 Vincent Celier + + * sem_aux.adb (Is_By_Reference_Type): For each components of + a record type, check also if the component is volatile as it + may have an aspect that makes it volatile. If it is, then the + record type is a by reference type. + 2014-02-18 Robert Dewar * exp_attr.adb: Minor reformatting. diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index 9aa7f4cac4f..dbe676da31f 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -782,8 +782,15 @@ package body Sem_Aux is begin C := First_Component (Btype); while Present (C) loop + + -- For each component, test if its type is a by reference + -- type and if its type is volatile. Also test the component + -- itself for being volatile. This happens for example when + -- a Volatile aspect is added to a component. + if Is_By_Reference_Type (Etype (C)) or else Is_Volatile (Etype (C)) + or else Is_Volatile (C) then return True; end if; -- 2.30.2