From: Piotr Trojanek Date: Thu, 11 Feb 2021 23:11:03 +0000 (+0100) Subject: [Ada] Fix detection of access-to-variable types X-Git-Tag: upstream/12.2.0~7226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=903655af70232eee31e5d83c59a45fa4d9e9ab00;p=platform%2Fupstream%2Fgcc.git [Ada] Fix detection of access-to-variable types gcc/ada/ * sem_prag.adb: Fix typos in comments related to access types. * sem_util.adb (Is_Access_Variable): Stronger condition. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 67b2f25..d52ad5c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2464,7 +2464,7 @@ package body Sem_Prag is if Global_Mode in Name_In_Out | Name_Output then - -- Constant of a access-to-variable type is a read-write + -- Constant of an access-to-variable type is a read-write -- item in procedures, generic procedures, protected -- entries and tasks. @@ -13431,7 +13431,7 @@ package body Sem_Prag is Arg1); end if; - -- Only other possibility is Access-to-class-wide type + -- Only other possibility is access-to-class-wide type elsif Is_Access_Type (Nm) and then Is_Class_Wide_Type (Designated_Type (Nm)) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 2024682..c9a2c9f 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -15386,8 +15386,9 @@ package body Sem_Util is function Is_Access_Variable (E : Entity_Id) return Boolean is begin - return Is_Access_Object_Type (E) - and then not Is_Access_Constant (E); + return Is_Access_Type (E) + and then not Is_Access_Constant (E) + and then Ekind (Directly_Designated_Type (E)) /= E_Subprogram_Type; end Is_Access_Variable; -----------------------------