!standard A.4.7(28) 10-11-18 AI05-0223-1/02 !standard A.4.8(28/2) !class binding interpretation 10-10-20 !status Amendment 2012 10-11-18 !status ARG Approved 6-0-3 10-10-30 !status work item 10-10-20 !status received 10-03-25 !priority Low !difficulty Easy !qualifier Omission !subject Wide_Maps needs finalization !summary Types Wide_Character_Set, Wide_Character_Mapping, and the corresponding Wide_Wide_ versions need finalization. !question Should the Wide_Character_Set and Wide_Character_Mapping types in Wide_Maps (and the corresponding types in Wide_Wide_Maps) be defined to "need finalization"? (Yes.) It's likely that dynamic allocation will be used to implement those types, and thus it's likely that they would be implemented using controlled types (or equivalent) to avoid memory leakage. !wording Add after A.4.7(28): Types Wide_Character_Set and Wide_Character_Mapping need finalization. Add after A.4.8(28/2): Types Wide_Wide_Character_Set and Wide_Wide_Character_Mapping need finalization. !discussion The intent of "needs finalization" is to prevent dependence on the actual implementation of the types. At least one major Ada implementation uses controlled types for these types, so they should "need finalization". !corrigendum A.4.7(28) @dinsa The context clause for each of the packages Strings.Wide_Fixed, Strings.Wide_Bounded, and Strings.Wide_Unbounded identifies Strings.Wide_Maps instead of Strings.Maps. @dinst Types Wide_Character_Set and Wide_Character_Mapping need finalization. !corrigendum A.4.8(28/2) @dinsa The context clause for each of the packages Strings.Wide_Wide_Fixed, Strings.Wide_Wide_Bounded, and Strings.Wide_Wide_Unbounded identifies Strings.Wide_Wide_Maps instead of Strings.Maps. @dinst Types Wide_Wide_Character_Set and Wide_Wide_Character_Mapping need finalization. !ACATS Test Possibly add test cases to the No_Nested_Finalization B-Tests for these types. !ASIS No impact on ASIS. !appendix !topic Should Wide_Maps types need finalization? !reference RM A.4.7, A.4.8, 7.6(9.6/2), AI95-360 !from Adam Beneschan 10-03-25 !discussion In AI95-360, Randy said: "As the comment says, that would make the application of the pragma (and thus the legality of the program) dependent on the precise implementation of the type. We don't want that, so we've introduced the concept of "needs finalization" and applied it to various language-defined types. (Perhaps there should also be a pragma to declare that for user-defined types, but that's another issue.) A type that "needs finalization" is one that *might* reasonably be implemented with a controlled part (thus type Integer doesn't need finalization). In general, we don't want the legality of programs to depend on what's in private parts, and that applies to restrictions as much as anything else." Given that, should the Wide_Character_Set and Wide_Character_Mapping types in Wide_Maps (and the corresponding types in Wide_Wide_Maps) be defined to "need finalization"? I think it's likely that dynamic allocation will be used to implement those types, and thus it's likely that they would be implemented using controlled types (or equivalent) to avoid memory leakage. ****************************************************************