If an incomplete_type_declaration includes the reserved word tagged, then a full_type_declaration that completes it shall declare a tagged type. The error for T3 is detected, but not T1 or T2. package pak1 is type T1 is tagged; type T2 is tagged; type T3 is tagged; protected type T1 is end T1; task type T2; type T3 is null record; end pak1; gnatmake -gnat05 pak1 gcc-4.1 -c -gnat05 pak1.ads pak1.ads:4:09: full declaration of type "T3" defined at line 7 must be tagged gnatmake -gnat05 pak1 gcc-4.3 -c -gnat05 pak1.ads pak1.ads:4:09: full declaration of type "T3" defined at line 7 must be tagged
Confirmed on GCC 4.4.0 20080409.
Subject: Bug 35792 Author: sam Date: Tue Apr 29 21:43:39 2008 New Revision: 134810 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134810 Log: 2008-04-29 Ed Schonberg <schonberg@adacore.com> gcc/ada/ PR ada/35792 * sem_ch3.adb (Find_Type_Name): Refuse completion of an incomplete tagged type by an untagged protected or task type. 2008-04-29 Samuel Tardieu <sam@rfc1149.net> gcc/testsuite/ PR ada/35792 * gnat.dg/specs/tag2.ads: New. Added: trunk/gcc/testsuite/gnat.dg/specs/tag2.ads Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/sem_ch3.adb trunk/gcc/testsuite/ChangeLog
This bug is now fixed in GCC 4.4.0.
The testcase doesn't pass though: http://gcc.gnu.org/ml/gcc-testresults/2008-05/msg00180.html
Yes, I've seen this, but I expect an answer to another one very soon, which would make the test case pass (I think the test case has the error message at the right place), that's why I haven't fixed it yet.