===================================================================
@@ -12945,11 +12945,16 @@
end if;
-- The expected type for a non-"null" argument is
- -- Root_Storage_Pool'Class.
+ -- Root_Storage_Pool'Class, and the pool must be a variable.
Analyze_And_Resolve
(Get_Pragma_Arg (Arg1),
Typ => Class_Wide_Type (RTE (RE_Root_Storage_Pool)));
+
+ if not Is_Variable (Expression (Arg1)) then
+ Error_Pragma_Arg
+ ("default storage pool must be a variable", Arg1);
+ end if;
end if;
-- Finally, record the pool name (or null). Freeze.Freeze_Entity
===================================================================
@@ -5383,8 +5383,13 @@
Check_Suspicious_Modulus (E);
end if;
+ -- the pool applies to named and anonymous access types, but not
+ -- to subprogram and to internal types generated for 'Access
+ -- references.
+
elsif Is_Access_Type (E)
and then not Is_Access_Subprogram_Type (E)
+ and then Ekind (E) /= E_Access_Attribute_Type
then
-- If a pragma Default_Storage_Pool applies, and this type has no
-- Storage_Pool or Storage_Size clause (which must have occurred