OK, I admit this one is particularly weird.

package P is
   procedure P2;
end P;

package body P is

   type Booleen is new Boolean;
   for Booleen use (-1, 1);

   function True return Booleen is
   begin
      return False;
   end True;

   type B is array (Booleen range False .. True) of Integer;

   procedure P1 is
      A : B;
   begin
      P2;
   end P1;

   procedure P2 is
      A : B; -- line 20
   begin
      P1;
   end P2;

end P;

+===========================GNAT BUG DETECTED==============================+
| 4.3.0 (i686-unknown-linux-gnu) in expand_expr_real_1, at expr.c:7290     |
| Error detected around p.adb:20

gnatmake p
gcc-4.3 -c p.adb
+===========================GNAT BUG DETECTED==============================+
| 4.3.3 (x86_64-pc-linux-gnu) in expand_expr_real_1, at expr.c:7312        |
| Error detected around p.adb:20                                           |


-- 
           Summary: ICE in legal program, Boolean type with user-defined
                    function True
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic at ludovic-brenta dot org


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

Reply via email to