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/23208] Illegal program not detected, RM 12.5.1(15, 28)


------- Additional Comments From ludovic dot brenta at insalien dot org  2005-08-03 05:14 -------
Yes, I was mistaken: RM 3.3(23) says: "A subtype is an indefinite subtype if it
is an unconstrained array subtype, or if it has unknown discriminants or
unconstrained discriminants without defaults, otherwise the subtype is a
definite subtype".  Therefore, R is a definite subtype since it has known
discriminants.  In contrast:

procedure Test_12_5_1 is
   generic
      type T is private;
   package P is
   end P;

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

   package PP is new P (T => Q.R);
begin
   null;
end Test_12_5_1;


Here, Q.R is indefinite and GNAT correcly diagnoses the problem:

test_12_5_1.adb:18:31: actual for "T" must be a definite subtype
gnatmake: "test_12_5_1.adb" compilation error

Marking this bug as INVALID (i.e. not a bug).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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