Commit 9fc154c8 by Ed Schonberg Committed by Arnaud Charlet

sem_ch13.adb (Analyze_Aspect_Specifications): For pre/postconditions copy the…

sem_ch13.adb (Analyze_Aspect_Specifications): For pre/postconditions copy the expression to the generated pragma...

2013-07-05  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch13.adb (Analyze_Aspect_Specifications): For
	pre/postconditions copy the expression to the generated pragma,
	to avoid sharing between the original aspect and the pragma node,
	because in ASIS_Mode both will be independently analyzed.

From-SVN: r200710
parent fa1608c2
2013-07-05 Ed Schonberg <schonberg@adacore.com> 2013-07-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): For
pre/postconditions copy the expression to the generated pragma,
to avoid sharing between the original aspect and the pragma node,
because in ASIS_Mode both will be independently analyzed.
2013-07-05 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Build_Variant_Record_Equality): Add pairs of * exp_ch3.adb (Build_Variant_Record_Equality): Add pairs of
formals for each discriminant of an unchecked union. formals for each discriminant of an unchecked union.
(Make_Eq_Case): Suprogram accepts a list of discriminants. Nested (Make_Eq_Case): Suprogram accepts a list of discriminants. Nested
......
...@@ -1799,13 +1799,16 @@ package body Sem_Ch13 is ...@@ -1799,13 +1799,16 @@ package body Sem_Ch13 is
end loop; end loop;
end if; end if;
-- Build the precondition/postcondition pragma -- Build the precondition/postcondition pragma. We copy
-- the expression to avoid sharing between the original
-- aspect and the pragma node, because in ASIS_Mode both
-- will be independently analyzed.
Make_Aitem_Pragma Make_Aitem_Pragma
(Pragma_Argument_Associations => New_List ( (Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Eloc, Make_Pragma_Argument_Association (Eloc,
Chars => Name_Check, Chars => Name_Check,
Expression => Relocate_Node (Expr))), Expression => New_Copy_Tree (Expr))),
Pragma_Name => Pname); Pragma_Name => Pname);
-- Add message unless exception messages are suppressed -- Add message unless exception messages are suppressed
......
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