aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-07-04 19:24:07 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-07-18 15:11:47 +0200
commitae250f9e3c6f469ff8ed6799225a7aaf6f75cce6 (patch)
tree271d22ef8baa870b240e718cc2303486a4bc95bd /libgcc
parent6c431c90947cb5a18d2b8807d5a94c644bd7021c (diff)
downloadgcc-ae250f9e3c6f469ff8ed6799225a7aaf6f75cce6.zip
gcc-ae250f9e3c6f469ff8ed6799225a7aaf6f75cce6.tar.gz
gcc-ae250f9e3c6f469ff8ed6799225a7aaf6f75cce6.tar.bz2
ada: Fix internal error on aggregates of self-referencing types
The front-end contains a specific mechanism to deal with aggregates of self-referencing types by means of the Has_Self_Reference flag, which is supposed to be set during semantic analysis and used during expansion. The problem is that the first part overlooks aggregates of derived types which implicitly contain references to an ancestor type (the second part uses a broader condition but it is effectively guarded by the first one). This changes both parts to use the same condition based on the Is_Ancestor predicate, which seems to implement the expected semantic in this case. gcc/ada/ * sem_type.ads (Is_Ancestor): Remove mention of tagged type. * exp_aggr.adb: Add with and use clauses for Sem_Type. (Build_Record_Aggr_Code.Replace_Type): Call Is_Ancestor to spot self-references to the type of the aggregate. * sem_aggr.adb (Resolve_Record_Aggregate.Add_Discriminant_Values): Likewise.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions