Bug 34251 - Illegal program not detected - component of type with limited public and nonlimited private view
Summary: Illegal program not detected - component of type with limited public and nonl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-27 21:07 UTC by Vadim Godunko
Modified: 2008-08-17 14:29 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-12-04 14:40:56


Attachments
testcase (546 bytes, text/plain)
2007-11-27 21:08 UTC, Vadim Godunko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Godunko 2007-11-27 21:07:53 UTC
Hello,

I have following output from the compiler for attached testcase:

gcc -c items.adb -gnat05
items.adb:11:21: expected type "System.Finalization_Implementation.Limited_Record_Controller"
items.adb:11:21: found type "System.Finalization_Implementation.Record_Controller"

This strange diagnosis seems as result of accept illegal program by the compiler. Type Item is a non-limited type with component of type with limited public and non-limited private view, so Item also must be a limited type.
Comment 1 Vadim Godunko 2007-11-27 21:08:31 UTC
Created attachment 14649 [details]
testcase
Comment 2 Samuel Tardieu 2007-12-04 14:40:56 UTC
Confirmed on trunk.

GNAT 4.3.0 20071203 (experimental)
Copyright 1992-2007, Free Software Foundation, Inc.

Compiling: items.adb (source file time stamp: 2007-12-04 14:40:16)

    11.         := new Item'(Kind => ASIS_Context, others => <>)
                            |
        >>> expected type "System.Finalization_Implementation.Limited_Record_Controller"
        >>> found type "System.Finalization_Implementation.Record_Controller"

 17 lines: 2 errors
Comment 3 Samuel Tardieu 2008-08-17 14:29:44 UTC
This appears to have been fixed in GCC 4.3.1.