This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^2] ada: Add limitations on the acceptable prefixes of 'Old
On 10/05, Robert Dewar wrote:
> Samuel Tardieu wrote:
>>>>>>> "Sam" == Samuel Tardieu <sam@rfc1149.net> writes:
>>
>> Sam> Here is an updated proposed patch:
>>
>> It doesn't still cover all the cases (since the requirement for
>> the prefix to denote an object is no longer present). For example, we
>> still get an ICE on this one:
>>
>> procedure T is
>> X : Integer := 3;
>> function F (A : Integer) return Integer is
>> begin
>> return A;
>> end F;
>> begin
>> pragma Assert (X = F(3)'Old);
>> null;
>> end T;
[...]
>> 8. pragma Assert (X = (X)'Old);
>> |
>> >>> binary operator expected
>
> This of course is illegal, (X) is not a name, so it is just
> a syntactic error, arbitrary expressions are definitely NOT
> allowed.
>
> Will look at rest of issues later ...
>>
>> Any idea on how to make this both robust and easy to understand?
Do you confirm that F(3)'Old should be forbidden as well? If it does, I
think I can produce a patch which fixes the other issues.