https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113037
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org Summary|GNAT BUG DETECTED when |assertion failure on |instantiating generic |illegal use of aspect |package with Type_Invariant |Type_Invariant |on a type derived from a | |generic type | Last reconfirmed| |2023-12-20 Keywords| |ice-on-invalid-code Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- This looks illegal though: "7.3.2 Type Invariants 1/5 {AI05-0146-1} {AI12-0041-1} {AI12-0396-1} For a private type, or private extension, or interface, the following language-defined assertion aspects may be specified with an aspect_specification (see 13.1.1): 2/3 {AI05-0146-1} {AI05-0250-1} Type_Invariant This aspect shall be specified by an expression, called an invariant expression. Type_Invariant may be specified on a private_type_declaration, on a private_extension_declaration, or on a full_type_declaration that declares the completion of a private type or private extension." but type Positive_Number is new Number with Type_Invariant => Number (Positive_Number) > Zero; is a full_type_declaration that declares a derived type.