sem_aux.adb (Is_By_Reference_Type): For each components of a record type...
authorVincent Celier <celier@adacore.com>
Tue, 18 Feb 2014 11:54:13 +0000 (11:54 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 18 Feb 2014 11:54:13 +0000 (12:54 +0100)
2014-02-18  Vincent Celier  <celier@adacore.com>

* 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
gcc/ada/sem_aux.adb

index 4f71051439ed69505643bce014a43e96d5809427..aed187cda97ff516c0a13cd7cd81b93228a614ef 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-18  Vincent Celier  <celier@adacore.com>
+
+       * 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  <dewar@adacore.com>
 
        * exp_attr.adb: Minor reformatting.
index 9aa7f4cac4ff8d97168ab47370beaf06768ef91a..dbe676da31f139fde1ddeb131fdf342f7136108c 100644 (file)
@@ -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;