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]

Re: [PATCH] ada/35792: Refuse completion of tagged type by task type or protected type



On Apr 29, 2008, at 5:21 PM, Samuel Tardieu wrote:


On 29/04, Edmond Schonberg wrote:

We've made the following patch to our GNAT sources. Thanks for pointing
out the missing checks here.

Thanks Ed. Could you send me the message and author to use for the ChangeLog? I'll take care of committing it into the FSF sources.

Sam


Here is  (I'm responsible for this)
===============================================

[Ada] Legality checks on completion of incomplete tagged types.

The compiler was not properly rejecting an untagged protected type or task type
that appears as the completion of an incomplete tagged type.


Compiling tag2.ads must be rejected with:

tag2.ads:5:09: full declaration of type "T3" defined at line 9 must be tagged
tag2.ads:7:19:
full declaration of type "T1" defined at line 3 must be a tagged type
tag2.ads:10:14:
full declaration of type "T4" defined at line 6 must be a tagged type


package tag2 is
   type I1 is synchronized interface;
   type T1 is tagged;
   type T2 is tagged;
   type T3 is tagged;
   type T4 is tagged;
   protected type T1 is end T1; -- { dg-error "must be a tagged type" }
   protected type T2 is new I1 with  entry E; end;
   type T3 is null record;      -- { dg-error "must be tagged" }
   task type T4;                -- { dg-error "must be a tagged type" }
end tag2;


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