diff options
author | Bob Duff <duff@adacore.com> | 2021-03-16 14:56:09 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-06-18 04:36:48 -0400 |
commit | 57841a43114d66a59322ce8b8d98b5e0096e5e36 (patch) | |
tree | 7f192882889e45509228da889fc77148a38e71a5 /gcc/ada/sem_util.ads | |
parent | 9c2886684f8263f5f63b15f358ce33bfc67d27ce (diff) | |
download | gcc-57841a43114d66a59322ce8b8d98b5e0096e5e36.zip gcc-57841a43114d66a59322ce8b8d98b5e0096e5e36.tar.gz gcc-57841a43114d66a59322ce8b8d98b5e0096e5e36.tar.bz2 |
[Ada] Warn on 'in out' param containing access in private type
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.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r-- | gcc/ada/sem_util.ads | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index e387d14..0519b3c 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1312,18 +1312,14 @@ package Sem_Util is -- limited, packed array and other implementation types. If Include_PAT -- is False, don't look inside packed array types. - function Has_Access_Values - (T : Entity_Id; Include_Internal : Boolean) return Boolean; - -- Returns true if type or subtype T is an access type, or has a component - -- (at any recursive level) that is an access type. This is a conservative - -- predicate, if it is not known whether or not T contains access values - -- (happens for generic formals in some cases), then False is returned. - -- Note that tagged types return False. Even though the tag is implemented - -- as an access type internally, this function tests only for access types - -- known to the programmer. See also Has_Tagged_Component. - -- - -- If Include_Internal is False, we return False for internal private types - -- whose full type contains access types. + function Has_Access_Values (T : Entity_Id) return Boolean; + -- Returns true if the underlying type of T is an access type, or has a + -- component (at any recursive level) that is an access type. This is a + -- conservative predicate, if it is not known whether or not T contains + -- access values (happens for generic formals in some cases), then False is + -- returned. Note that tagged types return False. Even though the tag is + -- implemented as an access type internally, this function tests only for + -- access types known to the programmer. See also Has_Tagged_Component. function Has_Anonymous_Access_Discriminant (Typ : Entity_Id) return Boolean; -- Returns True if Typ has one or more anonymous access discriminants |