comp.lang.ada
 help / color / mirror / Atom feed
* Bug or feature: representation makes aliasing with renaming declaration an error
@ 2012-06-20 19:46 Georg Bauhaus
  2012-06-20 20:45 ` Adam Beneschan
  0 siblings, 1 reply; 3+ messages in thread
From: Georg Bauhaus @ 2012-06-20 19:46 UTC (permalink / raw)


Hi,

Compiling: aliasing.ads (source file time stamp: 2012-06-20 19:41:48)

      1. package Aliasing is
      2.
      3.    type I is ('a', 'b', 'c');
      4.    for I use (11, 22, 33);              --!
      5.
      6.    type T is range 1 .. 10;
      7.    type Ary is array (I) of aliased T;
      8.    type Ptr is access constant T;
      9.
     10.    Vs : Ary;
     11.    Nm : T renames Vs('b');
     12.    X : Ptr := Nm'Access;
                       |
         >>> prefix of "Access" attribute must be aliased

     13.
     14. end Aliasing;

  14 lines: 1 error

The error goes away when line 4 is commented.
Is this expected behavior or is my compiler confused?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug or feature: representation makes aliasing with renaming declaration an error
  2012-06-20 19:46 Bug or feature: representation makes aliasing with renaming declaration an error Georg Bauhaus
@ 2012-06-20 20:45 ` Adam Beneschan
  2012-06-21 20:51   ` Georg Bauhaus
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Beneschan @ 2012-06-20 20:45 UTC (permalink / raw)


On Wednesday, June 20, 2012 12:46:09 PM UTC-7, Georg Bauhaus wrote:
> Hi,
> 
> Compiling: aliasing.ads (source file time stamp: 2012-06-20 19:41:48)
> 
>       1. package Aliasing is
>       2.
>       3.    type I is ('a', 'b', 'c');
>       4.    for I use (11, 22, 33);              --!
>       5.
>       6.    type T is range 1 .. 10;
>       7.    type Ary is array (I) of aliased T;
>       8.    type Ptr is access constant T;
>       9.
>      10.    Vs : Ary;
>      11.    Nm : T renames Vs('b');
>      12.    X : Ptr := Nm'Access;
>                        |
>          >>> prefix of "Access" attribute must be aliased
> 
>      13.
>      14. end Aliasing;
> 
>   14 lines: 1 error
> 
> The error goes away when line 4 is commented.
> Is this expected behavior or is my compiler confused?

This appears to be a compiler bug.

                            -- Adam



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug or feature: representation makes aliasing with renaming declaration an error
  2012-06-20 20:45 ` Adam Beneschan
@ 2012-06-21 20:51   ` Georg Bauhaus
  0 siblings, 0 replies; 3+ messages in thread
From: Georg Bauhaus @ 2012-06-21 20:51 UTC (permalink / raw)


On 20.06.12 22:45, Adam Beneschan wrote:

>>       12.    X : Ptr := Nm'Access;
>>                         |
>>           >>>  prefix of "Access" attribute must be aliased

>>
>> The error goes away when line 4 is commented.
>> Is this expected behavior or is my compiler confused?
>
> This appears to be a compiler bug.

Thank you for your judgement, this is reassuring.


FTR, bug report #53747 now addresses this for GCC 4.8.0.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-21 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 19:46 Bug or feature: representation makes aliasing with renaming declaration an error Georg Bauhaus
2012-06-20 20:45 ` Adam Beneschan
2012-06-21 20:51   ` Georg Bauhaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox