]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 10:44:14 +0000 (12:44 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 10:44:14 +0000 (12:44 +0200)
2011-08-29  Thomas Quinot  <quinot@adacore.com>

* sinfo.ads, sem_ch7.adb: Minor reformatting.

2011-08-29  Bob Duff  <duff@adacore.com>

* sem_ch4.adb (Analyze_Allocator): Check No_Nested_Finalization
restriction on allocators, as required by AI05-0013-1.
* restrict.ads: Minor comment fix.

From-SVN: r178198

gcc/ada/ChangeLog
gcc/ada/restrict.ads
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch7.adb
gcc/ada/sinfo.ads

index 38c160570e91df6bb00a08abfb56747e252403e1..9a8e2dcd4f6c88ceb35b0a0f5a0afd443376d172 100644 (file)
@@ -1,3 +1,13 @@
+2011-08-29  Thomas Quinot  <quinot@adacore.com>
+
+       * sinfo.ads, sem_ch7.adb: Minor reformatting.
+
+2011-08-29  Bob Duff  <duff@adacore.com>
+
+       * sem_ch4.adb (Analyze_Allocator): Check No_Nested_Finalization
+       restriction on allocators, as required by AI05-0013-1.
+       * restrict.ads: Minor comment fix.
+
 2011-08-29  Tristan Gingold  <gingold@adacore.com>
 
        * a-exexpr.adb, a-except-2005.ads (Jmpbuf_Address): Move to a-exexpr.adb
index f022bceccc85118d36fc6b7f1ca67bf10a5aaa68..a9b0c068e3b747a3ba063caa427e3ffe4af69a21 100644 (file)
@@ -39,7 +39,7 @@ package Restrict is
    --  consistency, restrictions found in any with'ed units, parent specs
    --  etc., since we may as well check as much as we can at compile time.
    --  These variables should not be referenced directly by clients. Instead
-   --  use Check_Restrictions to record a violation of a restriction, and
+   --  use Check_Restriction to record a violation of a restriction, and
    --  Restriction_Active to test if a given restriction is active.
 
    Restrictions_Loc : array (All_Restrictions) of Source_Ptr :=
index 3696bbb9bc81769dcc7c2aa639799f9e83aa428c..09d5b68995f549adfc146ea1055ad2748b2297eb 100644 (file)
@@ -702,6 +702,16 @@ package body Sem_Ch4 is
          Check_Restriction (No_Task_Allocators, N);
       end if;
 
+      --  AI05-0013-1: No_Nested_Finalization forbids allocators if the access
+      --  type is nested, and the designated type needs finalization. The rule
+      --  is conservative in that class-wide types need finalization.
+
+      if Needs_Finalization (Designated_Type (Acc_Type))
+        and then not Is_Library_Level_Entity (Acc_Type)
+      then
+         Check_Restriction (No_Nested_Finalization, N);
+      end if;
+
       --  Check that an allocator of a nested access type doesn't create a
       --  protected object when restriction No_Local_Protected_Objects applies.
       --  We don't have an equivalent to Has_Task for protected types, so only
index 471d0f8aa85e6cb2af82a10073e3aab38d8b55cc..8cf1170df5bae2e727e938a35ed949ae98aa6a25 100644 (file)
@@ -1195,7 +1195,8 @@ package body Sem_Ch7 is
       while Present (E) loop
 
          --  Check on incomplete types
-         --  AI05-213 : a formal incomplete type has no completion.
+
+         --  AI05-0213: a formal incomplete type has no completion
 
          if Ekind (E) = E_Incomplete_Type
            and then No (Full_View (E))
index 744d7cc7d2ed8928747f41124cc0bcc73df0bfde..87b018694ea5930701237cf57b81e41204f863a6 100644 (file)
@@ -943,11 +943,11 @@ package Sinfo is
    --    there is no requirement that these match, and there are obscure cases
    --    of generated code where they do not match.
 
-   --    Note: Aspect specifications, introduced in Ada2012, require additional
-   --    links between identifiers and various attributes. These attributes
-   --    can be of arbitrary types, and the entity field of identifiers that
-   --    denote aspects must be used to store arbitrary expressions for later
-   --    semantic checks. See section on Aspect specifications for details.
+   --    Note: Ada 2012 aspect specifications require additional links between
+   --    identifiers and various attributes. These attributes can be of
+   --    arbitrary types, and the entity field of identifiers that denote
+   --    aspects must be used to store arbitrary expressions for later semantic
+   --    checks. See section on aspect specifications for details.
 
    --  Entity_Or_Associated_Node (Node4-Sem)
    --    A synonym for both Entity and Associated_Node. Used by convention in
@@ -6237,9 +6237,9 @@ package Sinfo is
       --  | FORMAL_INTERFACE_TYPE_DEFINITION
       --  | FORMAL_INCOMPLETE_TYPE_DEFINITION
 
-      --  The Ada2012 syntax introduces two new non-terminals;
-      --  Formal_[Complete_| Incomplete_] Type_Declaration just to introduce
-      --  the later category. Here we introduce an incomplete type definition
+      --  The Ada 2012 syntax introduces two new non-terminals:
+      --  Formal_{Complete,Incomplete}_Type_Declaration just to introduce
+      --  the latter category. Here we introduce an incomplete type definition
       --  in order to preserve as much as possible the existing structure.
 
       ---------------------------------------------