when N_Attribute_Reference =>
if Attribute_Name (N) in Name_Access | Name_Unchecked_Access
and then Is_Entity_Name (Prefix (N))
- and then Is_Type (Entity (Prefix (N)))
and then Entity (Prefix (N)) = E
then
if Ada_Version < Ada_2012 then
Error_Msg_N ("aspect% cannot apply to subtype", Id);
goto Continue;
- elsif A_Id = Aspect_Default_Value
- and then not Is_Scalar_Type (E)
- then
- Error_Msg_N
- ("aspect% can only be applied to scalar type", Id);
- goto Continue;
+ elsif A_Id = Aspect_Default_Value then
+ if not Is_Scalar_Type (E) then
+ Error_Msg_N
+ ("aspect% can only be applied to scalar type", Id);
+ goto Continue;
+ end if;
elsif A_Id = Aspect_Default_Component_Value then
if not Is_Array_Type (E) then
-- If the end of declarations comes before any other freeze point,
-- the Freeze_Expr is not analyzed: no check needed.
- if Analyzed (Freeze_Expr) and then not In_Instance then
+ if Analyzed (Freeze_Expr) then
Check_Overloaded_Name;
else
Err := False;