procedure Test_12_5_1 is
   generic
      type T is private; -- should be type T (<>) is private;
   package P is
   end P;

   type R (B : Boolean := True) is record
      case B is
         when True => Component : Integer;
         when False => null;
      end case;
   end record;

   package PP is new P (T => R); -- line 14
begin
   null;
end Test_12_5_1;

In Ada 95, indefinite types no longer match generic formal types that don't have
a discriminant_part.

Expected output is along the lines of:
test_12_5_1.adb:14:29: actual type cannot be indefinite
test_12_5_1.adb:14:29: consider adding (<>) to the formal type declaration

The compiler says nothing.

Am I mistaken in believing that the type R is indefinite?

-- 
           Summary: Illegal program not detected, RM 12.5.1(15, 28)
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to