Message ID | 20180111091538.GA105733@adacore.com |
---|---|
State | New |
Headers | show |
Series | [Ada] Warning on out-of-range value for default-initialized scalar object | expand |
--- gcc/ada/exp_ch3.adb +++ gcc/ada/exp_ch3.adb @@ -6052,7 +6052,10 @@ package body Exp_Ch3 is and then not Has_Init_Expression (N) then Set_No_Initialization (N, False); - Set_Expression (N, Get_Simple_Init_Val (Typ, N, Esize (Def_Id))); + Set_Expression + (N, New_Copy_Tree + (Get_Simple_Init_Val (Typ, N, Esize (Def_Id)), + New_Sloc => Sloc (Obj_Def))); Analyze_And_Resolve (Expression (N), Typ); end if;