!standard 4.6 (05) 03-07-22 AI95-00330/01 !class binding interpretation 03-07-22 !status work item 03-07-22 !status received 03-04-16 !priority Low !difficulty Medium !qualifier Error !subject Generic actual parameters are always value conversions !summary A type conversion that is an actual generic in out parameter is a value conversion. !question The wording in 4.6(5) refers to an "actual parameter of mode out or in out" but it does not distinguish between an "actual parameter" of a subprogram call (per 6.4.1(3)) versus a "generic actual parameter" (per 12.3(7)). Is a type conversion used as a generic actual parameter of mode in out a view conversion or a value conversion? (A value conversion.) !recommendation (See summary.) !discussion The standard often does say "actual parameter" to mean "generic actual parameter". For examples, see 12.4(7) and 12.7(5). This ambiguity makes me wonder whether an untagged type conversion is officially considered to be a view conversion when it occurs as a "generic actual parameter" of a generic instantiation. I hope not. If a generic actual parameter of mode in out would qualify as a view conversion, then the legality of an object name used as a generic actual parameter would differ from that used in an object renaming declaration. Thus we confirm the behavior of the ACATS tests and tighten the wording of 4.6(5). !wording Change 4.6(5) to add "non-generic" in front of "actual parameter". !corrigendum 4.06(05) @drepl A @fa whose operand is the @fa of an object is called a @i if both its target type and operand type are tagged, or if it appears as an actual parameter of mode @b or @b; other @fas are called @i. @dby A @fa whose operand is the @fa of an object is called a @i if both its target type and operand type are tagged, or if it appears as a non-generic actual parameter of mode @b or @b; other @fas are called @i. !ACATS test ACATS tests BC3102A and BC3102B already test this case. !appendix !topic View conversion definition is ambiguous !reference RM95-4.6(5) !from Ivan Cvar 03-04-16 !keywords View conversion actual parameter generic !summary 4.6(5) usage of "actual parameter" is ambiguous with "generic actual parameter" !problem The wording in 4.6(5) refers to an "actual parameter of mode OUT or IN OUT" but it does not distinguish between an "actual parameter" of a subprogram call (per 6.4.1(3)) versus a "generic actual parameter" (per 12.3(7)). !discussion This ambiguity is reinforced by other occurrences in the RM where the term "actual parameter" does indeed refer to a "generic actual parameter". For examples, see 12.4(7) and 12.7(5), and the corrigendum has introduced a few more such occurrences. This ambiguity makes me wonder whether an untagged type conversion is officially considered to be a view conversion when it occurs as a "generic actual parameter" of a generic instantiation. I hope not. If a generic actual parameter of mode IN OUT would qualify as a view conversion, then bc3102a.ada and bc3102b.ada would be wrong. Furthermore, the legality of an object name used as a generic actual parameter would differ from that used in an object renaming declaration. !proposal Change 4.6(5) to disambiguate the wording. Perhaps: "actual parameter of a parameter association of mode OUT or IN OUT". Or perhaps add: "(but not a generic actual parameter)". !example PROCEDURE BC3102A IS -- abridged GENERIC TYPE T IS PRIVATE; VAR : IN OUT T; PACKAGE P IS END P; V : INTEGER := 4; TYPE DI IS NEW INTEGER; PACKAGE ZF IS NEW P (DI, DI(V)); -- ERROR (?): TYPE CONVERSION ILLEGAL_RENAMING : DI RENAMES DI(V); -- ILLEGAL (and not in orig. test) END; *************************************************************