[Ada] More permissive use of GNAT attribute Enum_Rep
authorEd Schonberg <schonberg@adacore.com>
Mon, 1 Jul 2019 13:37:37 +0000 (13:37 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 1 Jul 2019 13:37:37 +0000 (13:37 +0000)
commit7029d96f5a2e98500707ca9110e5ca569e062d13
tree323960aced50decdff1836f6ea1433a9e077e220
parent8b9aa1a98fd194ab8fad3f54e232172fd857f077
[Ada] More permissive use of GNAT attribute Enum_Rep

This patch allows the prefix of the attribute Enum_Rep to be an
attribute referece (such as Enum_Type'First). A recent patch had
restricted the prefix to be an object of a discrete type, which is
incompatible with orevious usage.

2019-07-01  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_attr.adb (Analyze_Attribute, case Enum_Rep): Allow prefix
of attribute to be an attribute reference of a discrete type.

gcc/testsuite/

* gnat.dg/enum_rep.adb, gnat.dg/enum_rep.ads: New testcase.

From-SVN: r272881
gcc/ada/ChangeLog
gcc/ada/sem_attr.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/enum_rep.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/enum_rep.ads [new file with mode: 0644]