This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Cannot rename component of Volatile_Full_Access object


It is not allowed to rename a component of a composite object to which
pragma Volatile_Full_Access has been applied. The following is compiled
with -gnatj55

     1. package RenamVFA is
     2.    type Int8_t is mod 2**8;
     3.    type Rec is record
     4.      A,B,C,D : Int8_t;
     5.    end record;
     6.    for Rec'Size use 32;
     7.    for Rec'Alignment use 4;
     8.    pragma Volatile_Full_Access (Rec);
     9.    R : Rec;
    10.    I1 : Int8_t renames R.A; -- illegal for now
                                |
        >>> cannot rename component of
            Volatile_Full_Access object

    11.    type Arr is array (1 .. 4) of Int8_t;
    12.    pragma Volatile_Full_Access (Arr);
    13.    A : Arr;
    14.    I2 : Int8_t renames A (1); -- illegal for now
                               |
        >>> cannot rename component of
            Volatile_Full_Access object

    15. end RenamVFA;

Tested on x86_64-pc-linux-gnu, committed on trunk

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.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]