https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123945
Bug ID: 123945
Summary: Mutable tagged types specified as generic formal types
can not be used for generic formal objects
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: liam at liampwll dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
See the below example which generates the error "expected type derived from
"T3b" defined at unknown location". Possibly related to PR/123306.
pragma Extensions_Allowed (All_Extensions);
procedure Example is
type Mutably_Tagged is tagged null record with Size'Class => 128;
type Normal_Tagged is tagged null record;
generic
type T is private;
X : Mutably_Tagged'Class; -- Works
Y : T; -- Error
package G is
end G;
package My_G is new
G
(T => Mutably_Tagged'Class,
X => Mutably_Tagged'Class (Mutably_Tagged'(null record)),
Y => Mutably_Tagged'Class (Mutably_Tagged'(null record)));
begin
null;
end Example;