aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 18:16:08 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 18:16:08 +0100
commitb2afe274d75c5bf9746de94d7dac38030e00f71e (patch)
tree15592e213f8216b3315f3437ce2fc40d6e90257a /gcc
parentb5eccd0cbd46ba49b361d67597284a94a4fdd8b7 (diff)
downloadgcc-b2afe274d75c5bf9746de94d7dac38030e00f71e.zip
gcc-b2afe274d75c5bf9746de94d7dac38030e00f71e.tar.gz
gcc-b2afe274d75c5bf9746de94d7dac38030e00f71e.tar.bz2
[multiple changes]
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/par-ch3.adb11
-rw-r--r--gcc/ada/s-os_lib.ads3
-rw-r--r--gcc/ada/sem_ch6.adb6
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cc6e73b..b3690eb 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 11e9f81..4f8afb0 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -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
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index 92bf50c..274810e0 100644
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -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;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index eea3200..f456131 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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;