CVS difference for ai05s/ai05-0225-1.txt
--- ai05s/ai05-0225-1.txt 2010/10/22 01:58:59 1.1
+++ ai05s/ai05-0225-1.txt 2011/01/25 05:26:14 1.2
@@ -1,5 +1,5 @@
-!standard A.4.7(28) 10-10-21 AI05-0225-1/01
-!standard A.4.8(28/2)
+!standard 9.5(7.1/2) 11-01-23 AI05-0225-1/02
+!standard 4.1.3(13.2/2)
!class binding interpretation 10-10-21
!status work item 10-10-21
!status received 10-06-04
@@ -9,13 +9,12 @@
!subject Call using constant protected objects
!summary
-It is illegal to use a constant prefix for a name that denotes a
-protected procedure or entry.
+A protected procedure or entry of a protected constant cannot be called.
!question
9.5(7.1) says, "The view of the target protected object associated
-with a call of a protected procedure or entry shall be a variable".
+with a call of a protected procedure or entry shall be a variable".
Is it the intent that this be allowed?
@@ -52,36 +51,50 @@
Add after 4.1.3(13.2/2): [Legality Rules]
-For a selected_component that denotes a protected procedure or protected entry,
-the prefix shall be a variable view Redundant[of a protected object].
+The name of a protected procedure or entry of a constant view of a protected
+object is illegal in the following cases: the name of a call, the prefix of an
+Access attribute, the name of a subprogram_renaming_declaration, an
+explicit_generic_actual_parameter, or the subprogram_default of a
+formal_subprogram_declaration.
+
+AARM Note: The point is to prevent any calls to such a name, directly, or via an
+access value, renames, or generic formal subprogram. It is, however, legal to
+say P'Count in a protected function body, even though the protected object is a
+constant view there.
Delete 9.5(7.1/2): [Legality Rules]
-The view of the target protected object associated with a call of a protected procedure
-or entry shall be a variable.
+The view of the target protected object associated with a call of a protected
+procedure or entry shall be a variable.
!discussion
This problem is similar to the one recently fixed for several
restrictions, such as No_Specific_Termination_Handlers.
-There is no value in allowing the use of a name of a callable
-entity that would be illegal to call, for the reasons shown
-in the question. Thus we make the selected component illegal.
+There is no value in allowing the use of a name of a callable entity that would
+be illegal to call, for the reasons shown in the question. Thus we make such
+cases illegal.
+
+We need to cover the case of a selected component, as well as the case where the
+protected object is implicit (when we're inside it). We explicitly enumerate the
+cases we are trying to prevent.
!ACATS Test
+An ACATS B-Test needs to be constructed to test examples like the one in the
+question (and others implied by the new rule).
!appendix
-!topic Call using constant protected objects
+!topic Call using constant protected objects
!reference 9.5(7.1)
!from Adam Beneschan 10-06-04
!discussion
9.5(7.1) says, "The view of the target protected object associated
-with a call of a protected procedure or entry shall be a variable".
+with a call of a protected procedure or entry shall be a variable".
Is it the intent that this be allowed?
@@ -121,5 +134,28 @@
it applies only to calls and not other uses of the protected procedure
or entry.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, January 24, 2011 11:20 PM
+
+...
+> !wording
+>
+> Add after 4.1.3(13.2/2): [Legality Rules]
+>
+> The name of a protected procedure or entry of a constant view
+> of a protected object is illegal in the following cases: the
+> name of a call, the prefix of an Access attribute, the name
+> of a subprogram_renaming_declaration, an
+> explicit_generic_actual_parameter, or the subprogram_default
+> of a formal_subprogram_declaration.
+
+This seems like an odd place for this rule, given that 4.1.3 is discussing
+selected components, but this rule covers some cases that have nothing to do
+with selected components. It would seem to make more sense to just replace the
+existing rule in 9.5(7.1/2) with this one. (We are deleting that rule anyway.)
+Or maybe there is a better place for this rule than either of these places??
****************************************************************
Questions? Ask the ACAA Technical Agent