aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.cc
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2022-03-25 12:56:24 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-17 08:25:48 +0000
commit867bf6f087e9566339cecce358319603ecd08248 (patch)
tree44272b8f08aca7e50f3b3506c501c60a571d9fa3 /gcc/fortran/openmp.cc
parentf2ef7a0545d1c17dd7e0ec8eb85b286d445dcc3f (diff)
downloadgcc-867bf6f087e9566339cecce358319603ecd08248.zip
gcc-867bf6f087e9566339cecce358319603ecd08248.tar.gz
gcc-867bf6f087e9566339cecce358319603ecd08248.tar.bz2
[Ada] Provide allocation subtype for allocators of a Designated_Storage_Model type
When an allocator is for an access type that has a Designated_Storage_Model aspect, and the designated type is an unconstrained record type with discriminants, and the subtype associated with the allocator is constrained, a dereference of the new access value can be passed to the designated type's initialization procedure. The post-front-end phase of the compiler needs to be able to create a temporary object in the host memory space to pass to the init proc, which requires creating such an object, but the subtype needed for the allocation isn't readily available at the point of the dereference. To make the subtype easily accessible, we set the Actual_Designated_Subtype of such a dereference to the subtype of the allocated object. gcc/ada/ * exp_ch4.adb (Expand_N_Allocator): For an allocator with an unconstrained discriminated designated type, and whose allocation subtype is constrained, set the Actual_Designated_Subtype of the dereference passed to the init proc of the designated type to be the allocation subtype. * sinfo.ads: Add documentation of new setting of Actual_Designated_Subtype on a dereference used as an actual parameter of call to an init proc associated with an allocator. Also add missing syntax and documentation for the GNAT language extension that allows an expression as a default for a concrete generic formal function.
Diffstat (limited to 'gcc/fortran/openmp.cc')
0 files changed, 0 insertions, 0 deletions