aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-12-03 15:49:17 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-12-03 15:49:17 +0000
commitd71753da57c28ded0e9d392c119ffbcdc0396360 (patch)
treee33f1dfab933ed791859f35d468a5c4bb37f6af3 /include
parent9f8483ca8f858ea19e3e0fcf567820e3195fe2de (diff)
downloadgcc-d71753da57c28ded0e9d392c119ffbcdc0396360.zip
gcc-d71753da57c28ded0e9d392c119ffbcdc0396360.tar.gz
gcc-d71753da57c28ded0e9d392c119ffbcdc0396360.tar.bz2
[Ada] Fix internal error on package instantiation on private type
This fixes an assertion failure in gigi triggered by the instantiation of a generic package, in a visible part of another package, done on a private type whose full view is a type derived from a scalar or an access type. The problem is that the front-end creates and inserts two different freeze nodes in the expanded tree for the partial and the full views of the private subtype created by the instantiation, which is not correct: partial and full views of a given (sub)type must point to the same freeze node, if any. The patch also adds an assertion checking this property in the front-end so as to catch the inconsistency higher in the chain. 2018-12-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * freeze.adb (Freeze_Entity): Do not freeze the partial view of a private subtype if its base type is also private with delayed freeze before the full type declaration of the base type has been seen. * sem_ch7.adb (Preserve_Full_Attributes): Add assertion on freeze node. gcc/testsuite/ * gnat.dg/generic_inst2.adb, gnat.dg/generic_inst2.ads, gnat.dg/generic_inst2_c.ads: New testcase. From-SVN: r266754
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions