+2008-04-15 Samuel Tardieu <sam@rfc1149.net>
+ Gary Dismukes <dismukes@adacore.com>
+
+ PR ada/28733
+ * sem_ch8.adb (Analyze_Use_Package): Do not allow "use" of something
+ which is not an entity (and hence not a package).
+ (End_Use_Package): Ditto.
+
2008-04-15 Ed Schonberg <schonberg@adacore.com>
PR ada/16086
Use_One_Package (Pack, N);
end if;
end if;
+
+ -- Report error because name denotes something other than a package
+
+ else
+ Error_Msg_N ("& is not a package", Pack_Name);
end if;
Next (Pack_Name);
begin
Pack_Name := First (Names (N));
while Present (Pack_Name) loop
- Pack := Entity (Pack_Name);
- if Ekind (Pack) = E_Package then
+ -- Test that Pack_Name actually denotes a package before processing
+
+ if Is_Entity_Name (Pack_Name)
+ and then Ekind (Entity (Pack_Name)) = E_Package
+ then
+ Pack := Entity (Pack_Name);
+
if In_Open_Scopes (Pack) then
null;