Commit 75bee270 by Ed Schonberg Committed by Arnaud Charlet

sem_prag.adb (Check_Precondition_Postcondition): When scanning the list of…

sem_prag.adb (Check_Precondition_Postcondition): When scanning the list of declaration to find previous subprogram...

2008-08-04  Ed Schonberg  <schonberg@adacore.com>

	* sem_prag.adb (Check_Precondition_Postcondition): When scanning the
	list of declaration to find previous subprogram, do not go to the
	original node of a generic unit.

From-SVN: r138579
parent 570d3cfb
......@@ -1425,7 +1425,18 @@ package body Sem_Prag is
P := N;
while Present (Prev (P)) loop
P := Prev (P);
PO := Original_Node (P);
-- If the previous node is a generic subprogram, do not go to
-- to the original node, which is the unanalyzed tree: we need
-- to attach the pre/postconditions to the analyzed version
-- at this point. They get propagated to the original tree when
-- analyzing the corresponding body.
if Nkind (P) not in N_Generic_Declaration then
PO := Original_Node (P);
else
PO := P;
end if;
-- Skip past prior pragma
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment