]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Missing predicate function body for derived type in nested package
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Jun 2018 09:19:02 +0000 (09:19 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Jun 2018 09:19:02 +0000 (09:19 +0000)
commitc10c3c8831f7e51ad60a0e61470214d170a5587f
treebaa878b90794ed360933fdeb99521c2938fdfc33
parentc1314460703d98f377074a206871eeba0a9f047e
[Ada] Missing predicate function body for derived type in nested package

This patch fixes a bug in the construction of predicate functions.  For a
derived type, we must ensure that the parent type is already frozen so that its
predicate function has been constructed already. This is necessary if the
parent is declared in a nested package and its own freeze point has not been
reached when the derived type is frozen by a local object declaration.

2018-06-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
that its parent is already frozen so that its predicate function, if
any, has already been constructed.

gcc/testsuite/

* gnat.dg/predicate1.adb: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261422 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/sem_ch13.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/predicate1.adb [new file with mode: 0644]