This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v3] ada: Allow 'Old attribute to be deeper in a subprogram
> The semantic analysis unnecessarily restricts the usage of the new 'Old
> attribute to the outermost scope of a subprogram body. The attached
> program will give an error:
>
> 4. if X = X'Old then
> |
> >>> attribute "Old" can only appear within subprogram
>
> This patch removes this limitation and allows 'Old to appear anywhere
> within a subprogram. Note that the expansion already does the correct
> job of looking up the outermost context in the subprogram to place the
> copy of the initial value there.
>
> Regtested on i686-pc-linux-gnu.
>
> Ok for trunk?
>
> gcc/ada/
> * sem_util.ads, sem_util.adb (In_Subprogram): New function.
> * sem_attr.adb (Analyze_Attribute, Attribute_Old case): Use it.
>
> gcc/testsuite/
> * gnat.dg/deep_old.adb: New.
This patch is OK, thanks.
Arno