aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-02-12 15:23:41 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-14 10:19:55 +0200
commit062626502fd5d56cd19c5e20c19f2d7cc2c03986 (patch)
tree5c62c2e95da26f41157d58866ca3f31d983a9b5d /include
parentab4a519a84611acc928ebbec920bd31e24993436 (diff)
downloadgcc-062626502fd5d56cd19c5e20c19f2d7cc2c03986.zip
gcc-062626502fd5d56cd19c5e20c19f2d7cc2c03986.tar.gz
gcc-062626502fd5d56cd19c5e20c19f2d7cc2c03986.tar.bz2
ada: Restore default size for dynamic allocations of discriminated type
The allocation strategy for objects of a discriminated type with defaulted discriminants is not the same when the allocation is dynamic as when it is static (i.e a declaration): in the former case, the compiler allocates the default size whereas, in the latter case, it allocates the maximum size. This restores the default size, which was dropped during the refactoring. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Pass N in the call to Build_Initialization_Call. (Build_Record_Aggr_Code): Likewise. (Convert_Aggr_In_Object_Decl): Likewise. (Initialize_Discriminants): Likewise. * exp_ch3.ads (Build_Initialization_Call): Replace Loc witn N. * exp_ch3.adb (Build_Array_Init_Proc): Pass N in the call to Build_Initialization_Call. (Build_Default_Initialization): Likewise. (Expand_N_Object_Declaration): Likewise. (Build_Initialization_Call): Replace Loc witn N parameter and add Loc local variable. Build a default subtype for an allocator of a discriminated type with defaulted discriminants. (Build_Record_Init_Proc): Pass the declaration of components in the call to Build_Initialization_Call. * exp_ch6.adb (Make_CPP_Constructor_Call_In_Allocator): Pass the allocator in the call to Build_Initialization_Call.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions