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] Fix problem with Error arg for Unevaluated_Use_Of_Old


The Error option for pragma Unevaluated_Use_Of_Old was not properly
recognized, due to an internal problem with the generation of the
names table for the Snames package. This is now corrected, and
the following program compiles as shown with -gnatld7 -gnatj60:

     1. package Uneval_Old is
     2.    pragma Unevaluated_Use_Of_Old (Error);
     3.    function F (X : Integer) return Integer;
     4.    procedure P (X : in out Integer) with
     5.      Post => (if X > 0 then X = F(X)'Old + 1);
                                        |
        >>> prefix of attribute "Old" that is potentially
            unevaluated must denote an entity

     6. end Uneval_Old;

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

2014-07-29  Robert Dewar  <dewar@adacore.com>

	* snames.ads-tmpl: Minor reformatting.
	* xsnamest.adb (XSnamesT): Remove special casing of Name_Error
	to give <Error>.  Not clear why this was there, but the compiler
	sources do not reference Name_Error, and this interfered with
	the circuits for pragma Unevaluated_Use_Of_Old.

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]