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  <de...@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.

Index: xsnamest.adb
===================================================================
--- xsnamest.adb        (revision 213156)
+++ xsnamest.adb        (working copy)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2014, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -255,10 +255,6 @@
                Name0 := 'O' & Translate (Name0, Lower_Case_Map);
             end if;
 
-            if Name0 = "error" then
-               Name0 := V ("<error>");
-            end if;
-
             if not Match (Name0, Chk_Low) then
                Put_Line (OutB, "     """ & Name0 & "#"" &");
             end if;
Index: snames.ads-tmpl
===================================================================
--- snames.ads-tmpl     (revision 213160)
+++ snames.ads-tmpl     (working copy)
@@ -56,8 +56,8 @@
 
    --  First we have the one character names used to optimize the lookup
    --  process for one character identifiers (to avoid the hashing in this
-   --  case) There are a full 256 of these, but only the entries for lower case
-   --  and upper case letters have identifiers
+   --  case) There are a full 256 of these, but only the entries for lower
+   --  case and upper case letters have identifiers
 
    --  The lower case letter entries are used for one character identifiers
    --  appearing in the source, for example in pragma Interface (C).

Reply via email to