Commit 4dd8320f by Ed Schonberg Committed by Pierre-Marie de Rodat

[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
parent 97b2ffb8
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> 2019-12-12 Steve Baird <baird@adacore.com>
* sem_ch6.adb * sem_ch6.adb
......
...@@ -2286,12 +2286,13 @@ package body Sem_Type is ...@@ -2286,12 +2286,13 @@ package body Sem_Type is
-- ration "type P is access Integer" and an anonymous access to Integer, -- 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 -- 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. -- 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 elsif Ada_Version >= Ada_2005
and then Ekind_In (Etype (L), E_Anonymous_Access_Type, and then Ekind_In (Etype (L), E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type) E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (R)) and then Is_Access_Type (Etype (R))
and then Ekind (Etype (R)) /= E_Access_Type
then then
return Etype (L); return Etype (L);
...@@ -2299,7 +2300,6 @@ package body Sem_Type is ...@@ -2299,7 +2300,6 @@ package body Sem_Type is
and then Ekind_In (Etype (R), E_Anonymous_Access_Type, and then Ekind_In (Etype (R), E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type) E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (L)) and then Is_Access_Type (Etype (L))
and then Ekind (Etype (L)) /= E_Access_Type
then then
return Etype (R); return Etype (R);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment