[Ada] Warn on 'in out' param containing access in predefined private type
authorBob Duff <duff@adacore.com>
Thu, 11 Mar 2021 22:20:41 +0000 (17:20 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 17 Jun 2021 14:32:16 +0000 (10:32 -0400)
commit4892e31daceb8ab230768a15eb0a01b814e8bbfd
tree7e62b0dc7b8c8573f11816736330ce562553c3bc
parente1dfbb03f98d5a039c996adaf60c076979d61d18
[Ada] Warn on 'in out' param containing access in predefined private type

gcc/ada/

* sem_util.adb, sem_util.ads (Has_Access_Values): New formal
Include_Internal to indicate whether internal types should be
included.
* sem_warn.adb (Check_References): Change E_Out_Parameter to
Formal_Kind, to match the comment about Spec_Entity.  Pass
Include_Internal => False to Has_Access_Values, so that we warn
on types with access values that happen to be in internal types,
such as Unbounded_String.
* sem_attr.adb (Attribute_Has_Access_Values): Pass
Include_Internal => True to Has_Access_Values, to preserve
existing behavior.
* libgnat/g-rewdat.adb (Do_Output): Change B from 'in out' to
'in', to avoid warning enabled by the change to sem_warn.adb.
* libgnat/s-objrea.adb (Check_Read_Offset): Change S from 'in
out' to 'in', to avoid warning enabled by the change to
sem_warn.adb.
gcc/ada/libgnat/g-rewdat.adb
gcc/ada/libgnat/s-objrea.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/sem_warn.adb