[Ada] Warn on 'in out' param containing access in private type

Pierre-Marie de Rodat derodat@adacore.com
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

gcc/ada/

	* 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
	Include_Internal parameter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 7196 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210618/649b74c2/attachment-0001.bin>


More information about the Gcc-patches mailing list