From 4dd8320fbb787527b417ba7e69ae3786b511e813 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Thu, 12 Dec 2019 10:03:48 +0000 Subject: [PATCH] [Ada] Spurious error on universal access equality operator 2019-12-12 Ed Schonberg gcc/ada/ * sem_type.adb (Find_Unique_Type): A call to the universal access equality operator requires one operand to be a universal access, and the other to be an access type. There is no requirement, as previously implied by this routine, that pool-specific access types were illegal in this context. From-SVN: r279304 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/sem_type.adb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 19e7fea30b9..f18df828896 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2019-12-12 Ed Schonberg + + * sem_type.adb (Find_Unique_Type): A call to the universal + access equality operator requires one operand to be a universal + access, and the other to be an access type. There is no + requirement, as previously implied by this routine, that + pool-specific access types were illegal in this context. + 2019-12-12 Steve Baird * sem_ch6.adb diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index fc5052421cf..e5d01dd095c 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -2286,12 +2286,13 @@ package body Sem_Type is -- ration "type P is access Integer" and an anonymous access to Integer, -- P is convertible to "access Integer" by 4.6 (24.11-24.15), but there -- is no rule in 4.6 that allows "access Integer" to be converted to P. + -- Note that this does not preclude one operand to be a pool-specific + -- access type, as a previous version of this code enforced. elsif Ada_Version >= Ada_2005 and then Ekind_In (Etype (L), E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) and then Is_Access_Type (Etype (R)) - and then Ekind (Etype (R)) /= E_Access_Type then return Etype (L); @@ -2299,7 +2300,6 @@ package body Sem_Type is and then Ekind_In (Etype (R), E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) and then Is_Access_Type (Etype (L)) - and then Ekind (Etype (L)) /= E_Access_Type then return Etype (R); -- 2.30.2