[Ada] Warn on 'in out' param containing access in private type
Pierre-Marie de Rodat
Fri Jun 18 08:38:27 GMT 2021
Normally the warnings:
warning: formal parameter "..." is not modified
warning: mode could be "in" instead of "in out"
are disabled if the type contains components of an access type.
A previous patch enabled such warnings if the only such components
are in internal private types.
This patch goes further, to all private types, whether or not internal.
Tested on x86_64-pc-linux-gnu, committed on trunk
* sem_util.ads, sem_util.adb (Has_Access_Values): Remove
Include_Internal parameter that was added in previous change.
* sem_warn.adb (Warnings_Off_E1): Back out E_Out_Parameter ==>
Formal_Kind change made previously. Check Is_Private_Type to
avoid warnings on private types. Misc cleanup.
* sem_attr.adb (Attribute_Has_Access_Values): Remove
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7196 bytes
Desc: not available
More information about the Gcc-patches