]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 24 Feb 2014 17:16:08 +0000 (18:16 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 24 Feb 2014 17:16:08 +0000 (18:16 +0100)
2014-02-24  Thomas Quinot  <quinot@adacore.com>

* s-os_lib.ads: Update comment.

2014-02-24  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (Analyze_Expression_Function): Use sloc of
original defining identifiers in parameter specifications for
body. They may differ from parameter specification itself if a
list of identifiers appears in the tree and is expanded by parser.

2014-02-24  Ed Schonberg  <schonberg@adacore.com>

* par-ch3.adb (P_Basic_Declarative_Items): If an improper body
appears in a list of basic declarations, complete the tree with
an empty statement list, to prevent cascaded errors and crashes
if semantic analysis is attempted.

From-SVN: r208090

gcc/ada/ChangeLog
gcc/ada/par-ch3.adb
gcc/ada/s-os_lib.ads
gcc/ada/sem_ch6.adb

index cc6e73bb7c0fd6f8e84290d4ea09da5f1fedca49..b3690ebc3bc3df5dad9226ef50fed7ba5d8f4529 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * par-ch3.adb (P_Basic_Declarative_Items): If an improper body
+       appears in a list of basic declarations, complete the tree with
+       an empty statement list, to prevent cascaded errors and crashes
+       if semantic analysis is attempted.
+
 2014-02-24  Thomas Quinot  <quinot@adacore.com>
 
        * g-sercom-mingw.adb (Open): Fix incorrect test for error return
index 11e9f81c4d16f41e7c3bd08d9da9fa3d61c1c383..4f8afb0286f460b09022288ce8f71bbff55158f8 100644 (file)
@@ -4626,6 +4626,17 @@ package body Ch3 is
          then
             Error_Msg ("proper body not allowed in package spec", Sloc (Decl));
 
+            --  Complete declaration of mangled subprogram body, for better
+            --  recovery if analysis is attempted.
+
+            if Nkind_In
+              (Decl, N_Subprogram_Body, N_Package_Body, N_Task_Body)
+            then
+               Set_Handled_Statement_Sequence (Decl,
+                 Make_Handled_Sequence_Of_Statements (Sloc (Decl),
+                   Statements => New_List));
+            end if;
+
          --  Test for body stub scanned, not acceptable as basic decl item
 
          elsif Kind in N_Body_Stub then
index 92bf50c8d2f9b0f0a66b2366d297f9137e08b137..274810e0ddb5bd5decf73d580eb19193f65c5a1c 100644 (file)
@@ -48,6 +48,9 @@
 --  be used by other predefined packages. User access to this package is via
 --  a renaming of this package in GNAT.OS_Lib (file g-os_lib.ads).
 
+--  Note: a distinct body for this spec is included in the .NET runtime library
+--  and must be kept in sync with changes made in this file.
+
 pragma Compiler_Unit;
 
 with System;
index eea32001c054028c76fdd5ddab0f586e9cf261d0..f456131f2e4c4395737479c31798b81575300be4 100644 (file)
@@ -311,10 +311,14 @@ package body Sem_Ch6 is
             Formal_Spec : Node_Id;
          begin
             Formal_Spec := First (Parameter_Specifications (New_Spec));
+
+            --  Create a new formal parameter at the same source position
+
             while Present (Formal_Spec) loop
                Set_Defining_Identifier
                  (Formal_Spec,
-                  Make_Defining_Identifier (Sloc (Formal_Spec),
+                  Make_Defining_Identifier
+                    (Sloc (Defining_Identifier (Formal_Spec)),
                     Chars => Chars (Defining_Identifier (Formal_Spec))));
                Next (Formal_Spec);
             end loop;