Version 1.3 of ai05s/ai05-0129-1.txt

Unformatted version of ai05s/ai05-0129-1.txt version 1.3
Other versions for file ai05s/ai05-0129-1.txt

!standard 10.1.1(12.3/2)          08-11-23 AI05-0129-1/01
!class binding interpretation 08-11-23
!status work item 08-11-23
!status received 08-11-23
!priority Low
!difficulty Medium
!qualifier Error
!subject A limited view does not contain views of incomplete types
A limited view of a package does not contain incomplete views of incomplete types declared in the package.
A question raised by discussion of the ASIS semantic subsystem at the Portland ARG meeting has led to discovery of a bug in the Ada Standard.
Someone wondered if the definition of completion was clear in the case of an incomplete view that is declared in a limited view for an incomplete type. For instance, in the limited view of the following package:
package P is type T; -- (1) type Acc_T is access T; type T is null record; -- (2) end P;
is the completion of T declaration (1) or (2)?
The question arises because both (1) and (2) are type_declarations by 3.2.1(2), so 10.1.1(12.3/2) says that an incomplete view is defined for both declarations. The language does not provide a way to chose between them, indeed, they would appear to be illegal homographs.
What is the intent here?
(See Summary.)
Modify 10.1.1(12.3/3):
For each type_declaration {that is not an incomplete_type_declaration} in the visible part, an incomplete view of the type; if the type_declaration is tagged, then the view is a tagged incomplete view.
Two identical (except for the completion) incomplete views with the same name in a single scope would seem to be an illegal homograph. Neither of these declarations is the completion of the other, nor do any of the other hidden from all visibility rules apply. So 8.3(26/2) seems to say that the limited view is illegal. But of course that is nonsense; we need to hide one of the declarations somehow.
But we can do better than fiddling with the visibility rules. 3.10.1(3) requires the completion of an incomplete type in a visible part to be in that same visible part. That means that there is no need for an incomplete view of the incomplete type to be declared in the limited view; there will always be an incomplete view of the completion in the same limited view.
So we adjust the wording to eliminate the declaration of incomplete views of incomplete types in a limited view.
!corrigendum 10.1.1(12.3/2)
Replace the paragraph:
An ACATS B-Test like the example in the question is needed.


Questions? Ask the ACAA Technical Agent