Fix bogus error on Value_Size clause for variant record type
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 10 Sep 2020 15:59:11 +0000 (17:59 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 10 Sep 2020 16:00:57 +0000 (18:00 +0200)
commite63eb26d22dbbbbb67f7f240ea5a7234cd2498cb
treecc0a7633f6e4adc2d8ed81b0af58568d584a2ce6
parent71465223b95af43951c423ad77391e706f02901d
Fix bogus error on Value_Size clause for variant record type

This is a regression present on the mainline and 10 branch: the compiler
rejects a Value_Size clause on a discriminated record type with variant.

gcc/ada/ChangeLog:
* gcc-interface/decl.c (set_rm_size): Do not take into account the
Value_Size clause if it is not for the entity itself.

gcc/testsuite/ChangeLog:
* gnat.dg/specs/size_clause5.ads: New test.
gcc/ada/gcc-interface/decl.c
gcc/testsuite/gnat.dg/specs/size_clause5.ads [new file with mode: 0644]