Commit b08f42ae by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Fix propagation of compiler internal flag

No change in behavior for GCC-based compilations.

2019-08-20  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch3.adb (Analyze_Object_Declaration): If actual type is
	private and distinct from nominal type in declaration, propagate
	flags Is_Constr_Subt_For_U_Nominal and _UN_Aliased to full view
	of private type.

From-SVN: r274735
parent b6b011dd
2019-08-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): If actual type is
private and distinct from nominal type in declaration, propagate
flags Is_Constr_Subt_For_U_Nominal and _UN_Aliased to full view
of private type.
2019-08-20 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_Loop_Entry_Attribute): When expanding a
loop entry attribute for a while_loop we construct a function
that incorporates the expanded condition of the loop. The itypes
......
......@@ -3923,6 +3923,7 @@ package body Sem_Ch3 is
-- Save the Ghost-related attributes to restore on exit
Related_Id : Entity_Id;
Full_View_Present : Boolean := False;
-- Start of processing for Analyze_Object_Declaration
......@@ -4645,10 +4646,25 @@ package body Sem_Ch3 is
Act_T := Find_Type_Of_Object (Object_Definition (N), N);
end if;
-- Propagate attributes to full view when needed.
Set_Is_Constr_Subt_For_U_Nominal (Act_T);
if Is_Private_Type (Act_T) and then Present (Full_View (Act_T))
then
Full_View_Present := True;
end if;
if Full_View_Present then
Set_Is_Constr_Subt_For_U_Nominal (Full_View (Act_T));
end if;
if Aliased_Present (N) then
Set_Is_Constr_Subt_For_UN_Aliased (Act_T);
if Full_View_Present then
Set_Is_Constr_Subt_For_UN_Aliased (Full_View (Act_T));
end if;
end if;
Freeze_Before (N, Act_T);
......
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