]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Allow component clauses for certain record components with discriminants
authorRonan Desplanques <desplanques@adacore.com>
Mon, 24 Nov 2025 08:55:56 +0000 (09:55 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 9 Jan 2026 10:57:12 +0000 (11:57 +0100)
commit5d24c744d41f7b0cada458d5cde1a50d690d10f2
tree7ddfecb37830027b9e9f76d645fcb2decf3bd36f
parent48f841e26082d21b5a4d0d314161b79d3ba9f935
ada: Allow component clauses for certain record components with discriminants

Before this patch, the compiler rejected record representation clauses
when a component has a subtype with a non-static discriminant constraint.
This is a somewhat coarse-grained since the size of such a component can
be constant relatively to the discriminant. One such case in particular
is when the component subtype is an unchecked union.

This patch makes the compiler accept the unchecked union case.

gcc/ada/ChangeLog:

* freeze.adb (Size_Known): Modify rejection condition.
gcc/ada/freeze.adb