CVS difference for ai12s/ai12-0155-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0155-1.txt

--- ai12s/ai12-0155-1.txt	2015/03/06 05:55:26	1.2
+++ ai12s/ai12-0155-1.txt	2015/03/18 04:14:45	1.3
@@ -1,4 +1,4 @@
-!standard 13.14(3/4)                                   15-03-05  AI05-0155-1/01
+!standard 13.14(3/4)                                   15-03-17  AI05-0155-1/02
 !class binding interpretation 15-02-20
 !status work item 15-02-20
 !status received 15-02-20
@@ -144,22 +144,35 @@
 is bad news.) We did not add any exception for the freezing of such profiles,
 thus 13.14(17/3) would be violated and the instance is illegal.
 
-Interestingly, this seems to show a problem with calling of subprograms
-with parameters of tagged incomplete types. Such calls are explicitly allowed
-by 3.10.1(10/3) [note that it only ban actual parameters of *untagged*
-incomplete views]. Since all calls freeze the profiles of the associated
-subprograms, any call whose parameters are tagged incomplete types
+We could have added another exception to 13.14(10.2/3) to allow that program.
+Something like: "Freezing a profile in this case only freezes types that
+are not tagged incomplete." Argubly, that should also be done, as it's somewhat
+odd to allow calls to subprograms but not to allow the same subprogram to be
+used as a formal parameter.
+
+We didn't add such a rule as almost all *useful* calls to subprograms with
+incomplete parameters have to occur in some other compilation unit (typically,
+a child unit). Moreover, all such local calls already are freezing violations.
+[Calls of subprograms with parameters of tagged incomplete types are explicitly
+allowed by 3.10.1(10/3) (note that it only ban actual parameters of *untagged*
+incomplete views). Since all calls freeze the profiles of the associated
+subprograms, any (local) call whose parameters are tagged incomplete types
 without a completion will be illegal because of 3.10.1(9.3/2). That's
-intentional for cases like the one in AI12-0017-1. And it doesn't seem to
-be a problem *assuming* that any entity imported via a *with* is already
-frozen (somewhere) - some other unit must have the completion or the partition
-is illegal. (The language rules don't make this clear, probably they ought to.)
-With that assumption, any problematic call would either violate some other
-freezing rule (expression functions) or fail an elaboration check (other
-subprograms). Thus, we don't need to fix the problem, although it means that
-a generic cannot be instantiated in the same scope as these operations.
-(Which is annoying, but not fatal, as the instance could have been in the child
-unit, where no freezing would apply [we assume!].)
+intentional for cases like the one in AI12-0017-1.]
+
+Calls in other units are OK, *assuming* that any entity imported via a *with*
+(or from a parent, which is another form of semantic dependence; those should
+all be treated equivalently) is already frozen (somewhere). That makes sense,
+as some other unit must have the completion or the partition is illegal.
+However, the language rules don't make this clear. It's definitely significant
+for various kinds of incomplete types -- we surely don't want anyone to think
+that incomplete views from a limited with need to have a completion visible
+somewhere in order to declare or call a subprogram, and the same is true for
+Taft-Amendment incomplete types. With that assumption, we don't need to fix
+the generic problem, although it means that a generic cannot be instantiated
+in the same scope as these operations. (Which is annoying, but not fatal, as
+the instance could have been in the child unit, where no freezing would
+apply [we assume!].)
 
 Note that this instance caused an internal error in GNAT very similar to the
 one caused by the calls in the ACATS-style test for the example in the

Questions? Ask the ACAA Technical Agent