+2018-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
+ entity E within a generic unit, indicate that there are no remaining
+ delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
+ entity E is not frozen yet but the aspects should not be reanalyzed at
+ the freeze point, which may be outside of the generic and may not have
+ the proper visibility.
+
2018-05-22 Bob Duff <duff@adacore.com>
* doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
-- be frozen in the proper scope after the current generic is analyzed.
-- However, aspects must be analyzed because they may be queried later
-- within the generic itself, and the corresponding pragma or attribute
- -- definition has not been analyzed yet.
+ -- definition has not been analyzed yet. After this, indicate that the
+ -- entity has no further delayed aspects, to prevent a later aspect
+ -- analysis out of the scope of the generic.
elsif Inside_A_Generic and then External_Ref_In_Generic (Test_E) then
if Has_Delayed_Aspects (E) then
Analyze_Aspects_At_Freeze_Point (E);
+ Set_Has_Delayed_Aspects (E, False);
end if;
Result := No_List;