This is the mail archive of the gcc-bugs@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]

[Bug ada/22381] New: Ada produces mis-match (non compatible) types in MODIFY_EXPR


Take the following reduced testcase:
package body GNAT.Sockets is
   function To_Inet_Addr return Inet_Addr_Type
   is
      Result : Inet_Addr_Type;
   begin
      return Result;
   end To_Inet_Addr;
end GNAT.Sockets;
package GNAT.Sockets is
   type Family_Type is (Family_Inet, Family_Inet6);
   type Inet_Addr_Type (Family : Family_Type := Family_Inet) is private;
   function To_Inet_Addr  return Inet_Addr_Type;
private
   subtype Inet_Addr_Comp_Type is Natural range 0 .. 255;
   type Inet_Addr_VN_Type is array (Natural range <>) of Inet_Addr_Comp_Type;
   subtype Inet_Addr_V4_Type is Inet_Addr_VN_Type (1 ..  4);
   subtype Inet_Addr_V6_Type is Inet_Addr_VN_Type (1 .. 16);
   type Inet_Addr_Type (Family : Family_Type := Family_Inet) is record
      case Family is
         when Family_Inet =>
            Sin_V4 : Inet_Addr_V4_Type := (others => 0);
         when Family_Inet6 =>
            Sin_V6 : Inet_Addr_V6_Type := (others => 0);
      end case;
   end record;
end GNAT.Sockets;

Using the patch in PR 22368, we get an ICE:
g-socket.adb: In function 'GNAT.SOCKETS.TO_INET_ADDR':
g-socket.adb:8: error: statement types mismatch
*TARGETD.469 = resultD.524;

struct gnat__sockets__inet_addr_typeD.454
struct gnat__sockets__to_inet_addr__result___PAD

Looking at the types we are missing a COMPONENT_REF.

-- 
           Summary: Ada produces mis-match (non compatible) types in
                    MODIFY_EXPR
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 22368
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22381


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