The tweak is to add the name of the constant to the error message. That's
a minor improvement in this simple case, but it will help for the same error
in a more complex case.
gcc/ada/ChangeLog:
* sem_res.adb (Resolve_Entity_Name): Add the name of the constant
to the error message for premature freezing of deferred constants.
and then not Is_Imported (E)
and then Nkind (Parent (E)) /= N_Object_Renaming_Declaration
and then not Needs_Construction (Etype (E))
+ and then not No_Initialization (Parent (E))
+ and then not (Present (Full_View (E))
+ and then No_Initialization (Parent (Full_View (E))))
then
- if No_Initialization (Parent (E))
- or else (Present (Full_View (E))
- and then No_Initialization (Parent (Full_View (E))))
- then
- null;
- else
- Error_Msg_N
- ("deferred constant is frozen before completion", N);
- end if;
+ Error_Msg_NE
+ ("deferred constant& is frozen before completion", N, E);
end if;
Eval_Entity_Name (N);