]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix assertion failure on illegal use of aspect Type_Invariant
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Oct 2024 10:58:55 +0000 (11:58 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:05:44 +0000 (14:05 +0100)
commit0362d7aa8fcdb63505a6b37a36fc7cc5845ba80c
treebf4690d983dc0b3655d2d859cff1032a2931ab79
parent3408792e6016a53cbc10653948e07132d0f13361
ada: Fix assertion failure on illegal use of aspect Type_Invariant

The illegal use is on a type derived from a formal private type, e.g.:

generic

  type T is private;

package G is

  type D is new T with Type_Invariant => True;

end G;

gcc/ada/ChangeLog:

PR ada/113037
* sem_prag.adb (Analyze_Pragma) <Pragma_Invariant>: Reject types
that are derived from formal private types.
gcc/ada/sem_prag.adb