diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-12-12 10:03:48 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-12 10:03:48 +0000 |
commit | 4dd8320fbb787527b417ba7e69ae3786b511e813 (patch) | |
tree | 729d5f3b2b3b7772c240702c5fa8bec56bb9711e | |
parent | 97b2ffb81fdef1f0c2dc3ec337a9d9a61f3b98fc (diff) | |
download | gcc-4dd8320fbb787527b417ba7e69ae3786b511e813.zip gcc-4dd8320fbb787527b417ba7e69ae3786b511e813.tar.gz gcc-4dd8320fbb787527b417ba7e69ae3786b511e813.tar.bz2 |
[Ada] Spurious error on universal access equality operator
2019-12-12 Ed Schonberg <schonberg@adacore.com>
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
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/sem_type.adb | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 19e7fea..f18df82 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2019-12-12 Ed Schonberg <schonberg@adacore.com> + + * 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 <baird@adacore.com> * sem_ch6.adb diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index fc50524..e5d01dd 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); |