This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix spurious error on access discriminant


2001-12-04  Ed Schonberg <schonber@gnat.com>

	* sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide 
	access discriminant within a type extension that constrains its 
	parent discriminants.

*** sem_attr.adb	2001/09/26 00:05:02	1.553
--- sem_attr.adb	2001/10/16 14:22:34	1.554
***************
*** 6280,6297 ****
                       if not Covers (Designated_Type (Typ), Nom_Subt)
                         and then not Covers (Nom_Subt, Designated_Type (Typ))
                       then
-                         if Is_Anonymous_Tagged_Base
-                              (Nom_Subt, Etype (Designated_Type (Typ)))
-                         then
-                            null;
  
!                         else
!                            Error_Msg_NE
!                              ("type of prefix: & not compatible", P, Nom_Subt);
!                            Error_Msg_NE
!                              ("\with &, the expected designated type",
!                                P, Designated_Type (Typ));
!                         end if;
                       end if;
  
                    elsif not Covers (Designated_Type (Typ), Nom_Subt)
--- 6280,6308 ----
                       if not Covers (Designated_Type (Typ), Nom_Subt)
                         and then not Covers (Nom_Subt, Designated_Type (Typ))
                       then
  
!                         declare
!                            Desig : Entity_Id;
! 
!                         begin
!                            Desig := Designated_Type (Typ);
! 
!                            if Is_Class_Wide_Type (Desig) then
!                               Desig := Etype (Desig);
!                            end if;
! 
!                            if Is_Anonymous_Tagged_Base (Nom_Subt, Desig) then
!                               null;
! 
!                            else
!                               Error_Msg_NE
!                                 ("type of prefix: & not compatible",
!                                   P, Nom_Subt);
!                               Error_Msg_NE
!                                 ("\with &, the expected designated type",
!                                   P, Designated_Type (Typ));
!                            end if;
!                         end;
                       end if;
  
                    elsif not Covers (Designated_Type (Typ), Nom_Subt)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]