[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
This commit is contained in:
Arnaud Charlet 2014-02-24 18:16:08 +01:00
parent b5eccd0cbd
commit b2afe274d7
4 changed files with 26 additions and 1 deletions

View 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

View 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

View 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;

View 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;