[multiple changes]

2009-04-29  Ed Schonberg  <schonberg@adacore.com>

	* sem_disp.adb (Check_Dispatching_Operation): if the dispatching
	operation is a body without previous spec, update the list of
	primitive operations to ensure that cross-reference information is
	up-to-date.

	* sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): When creating a
	new compilation unit node for the instance declaration, keep the
	context items of the original unit on it, so that the context of the
	instance body only holds the context inherited from the generic body.

2009-04-29  Bob Duff  <duff@adacore.com>

	* sem_res.adb: Minor comment fix.

From-SVN: r146945
This commit is contained in:
Arnaud Charlet 2009-04-29 12:28:55 +02:00
parent 7f4c190364
commit 4fc26524b5
4 changed files with 31 additions and 5 deletions

View File

@ -1,3 +1,19 @@
2009-04-29 Ed Schonberg <schonberg@adacore.com>
* sem_disp.adb (Check_Dispatching_Operation): if the dispatching
operation is a body without previous spec, update the list of
primitive operations to ensure that cross-reference information is
up-to-date.
* sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): When creating a
new compilation unit node for the instance declaration, keep the
context items of the original unit on it, so that the context of the
instance body only holds the context inherited from the generic body.
2009-04-29 Bob Duff <duff@adacore.com>
* sem_res.adb: Minor comment fix.
2009-04-29 Thomas Quinot <quinot@adacore.com>
* sem_elim.adb: Minor reformatting

View File

@ -4360,16 +4360,19 @@ package body Sem_Ch12 is
Old_Main : constant Entity_Id := Cunit_Entity (Main_Unit);
begin
-- A new compilation unit node is built for the instance declaration
-- A new compilation unit node is built for the instance declaration.
-- Place the context of the compilation this declaration, so that it
-- it is processed before the instance in CodePeer.
Decl_Cunit :=
Make_Compilation_Unit (Sloc (N),
Context_Items => Empty_List,
Context_Items => Context_Items (Parent (N)),
Unit => Act_Decl,
Aux_Decls_Node =>
Make_Compilation_Unit_Aux (Sloc (N)));
Set_Parent_Spec (Act_Decl, Parent_Spec (N));
Set_Context_Items (Parent (N), Empty_List);
-- The new compilation unit is linked to its body, but both share the
-- same file, so we do not set Body_Required on the new unit so as not

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
@ -865,7 +865,14 @@ package body Sem_Disp is
Prim => Subp));
end if;
Generate_Reference (Tagged_Type, Subp, 'p', False);
-- Indicate that this is an overriding operation,
-- and replace the overriden entry in the list of
-- primitive operations, which is used for xref
-- generation subsequently.
Generate_Reference (Tagged_Type, Subp, 'P', False);
Override_Dispatching_Operation
(Tagged_Type, Old_Subp, Subp);
end if;
end if;
end if;

View File

@ -6977,7 +6977,7 @@ package body Sem_Res is
begin
-- The parser folds an enormous sequence of concatenations of string
-- literals into "" & "...", where the Is_Folded_In_Parser flag is set
-- in the right. If the expression resolves to a predefined "&"
-- in the right operand. If the expression resolves to a predefined "&"
-- operator, all is well. Otherwise, the parser's folding is wrong, so
-- we give an error. See P_Simple_Expression in Par.Ch4.