Bug or legit? Instantiation in body of preelaborable generic complains about non-static constant

So this is happening to me, here is a minimal example. Sadly, it requires both spec and body. Note that the library must be generic and the instantiation in the body for the error to be reported; otherwise everything works still being Preelaborate (either non-generic lib or instance in spec).

This is with GNAT 10 to 14.

generic
package Bug with Preelaborate is
   
   type Any is tagged private;
   
   function Make return Any;
   
private
   
   type Any is tagged null record;

end Bug;

with Ada.Containers.Indefinite_Vectors;

package body Bug is
   
   function Make return Any is (null record);
   
   package Vectors is new Ada.Containers.Indefinite_Vectors
     (Positive, Any'Class);
   
end Bug;

The stream of errors at the instantiation point is:

bug.adb:7:04: error: instantiation error at a-coinve.ads:541
bug.adb:7:04: error: non-static constant in preelaborated unit
bug.adb:7:04: error: instantiation error at a-coinve.ads:541
bug.adb:7:04: error: "T_Check" is not a static constant (RM 4.9(5))
bug.adb:7:04: error: instantiation error at a-conhel.ads:88
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: non-static constant in preelaborated unit
bug.adb:7:04: error: instantiation error at a-conhel.ads:88
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: "T_Check" is not a static constant (RM 4.9(5))
bug.adb:7:04: error: instantiation error at a-conhel.ads:160
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: non-static constant in preelaborated unit
bug.adb:7:04: error: instantiation error at a-conhel.ads:160
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: "T_Check" is not a static constant (RM 4.9(5))
bug.adb:7:04: error: instantiation error at a-conhel.ads:166
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: non-static constant in preelaborated unit
bug.adb:7:04: error: instantiation error at a-conhel.ads:166
bug.adb:7:04: error: instantiation error at a-coinve.ads:407
bug.adb:7:04: error: "T_Check" is not a static constant (RM 4.9(5))
gprbuild: *** compilation phase failed

I look into the reported lines and indeed I see things that don’t seem to be static, but I don’t think this is intended; besides it working in the other cases I mentioned which doesn’t make sense to me.

So, legit or not?

Noting there looks wrong.
Have you tried adding Preelaborable_Initialization to the Any type?

Yes, it made no difference.

T_Check is part of GNAT’s internal implementation of Ada.Containers.* in general, so this must be a compiler error.