Bug 35792 - Illegal program not detected, RM 3.10.1(4/2)
Summary: Illegal program not detected, RM 3.10.1(4/2)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: 4.4.0
Assignee: Samuel Tardieu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-01 21:18 UTC by Ludovic Brenta
Modified: 2008-05-04 23:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.1.2 4.3.0
Last reconfirmed: 2008-04-09 13:38:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2008-04-01 21:18:47 UTC
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
Comment 1 Samuel Tardieu 2008-04-09 13:38:24 UTC
Confirmed on GCC 4.4.0 20080409.
Comment 2 Samuel Tardieu 2008-04-29 21:44:33 UTC
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

Comment 3 Samuel Tardieu 2008-04-29 21:46:02 UTC
This bug is now fixed in GCC 4.4.0.
Comment 4 Eric Botcazou 2008-05-03 15:23:06 UTC
The testcase doesn't pass though:
  http://gcc.gnu.org/ml/gcc-testresults/2008-05/msg00180.html
Comment 5 Samuel Tardieu 2008-05-04 23:03:49 UTC
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.