diff options
author | Gary Dismukes <dismukes@adacore.com> | 2024-04-17 23:44:41 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-10 11:04:01 +0200 |
commit | f5e372e2a31c19ed0c784cfb3ebd373802a106ff (patch) | |
tree | 163e3f61182c404dfcf40d55b99d6bee337263c3 /missing | |
parent | 9bf9e60e262f54d87b146a2a322a8ad6324301ea (diff) | |
download | gcc-f5e372e2a31c19ed0c784cfb3ebd373802a106ff.zip gcc-f5e372e2a31c19ed0c784cfb3ebd373802a106ff.tar.gz gcc-f5e372e2a31c19ed0c784cfb3ebd373802a106ff.tar.bz2 |
ada: Derived type with convention C must override convention C_Pass_By_Copy
If a type DT is derived from a record type T with convention C_Pass_By_Copy
and explicitly specifies convention C (via aspect or pragma), then type DT
should not be treated as a type with convention C_Pass_By_Copy. Any parameters
of the derived type should be passed by reference rather than by copy. The
compiler was incorrectly inheriting convention C_Pass_By_Copy, by inheriting
the flag set on the parent type, but that flag needs to be unset in the case
where the convention is overridden.
gcc/ada/
* sem_prag.adb (Set_Convention_From_Pragma): If the specified convention on
a record type is not C_Pass_By_Copy, then force the C_Pass_By_Copy flag to
False, to ensure that it's overridden.
Diffstat (limited to 'missing')
0 files changed, 0 insertions, 0 deletions