!ASIS Issue #077
!topic  Renaming-as-body and renaming-as-declaration
!reference  ASIS 95-15.26
!from  Sergey Rybin 97-04-28
!keywords  Corresponding_Declaration, A_Procedure_Renaming_Declaration, A_Function_Renaming_Declaration, Corresponding_Body
!discussion

Suppose we have a declaration of the procedure Foo. and it is completed
by ranaming-as-body. There is a way to go from the declaration
to this (renaming-as-)body - to apply Asis.Declarations.Corresponding_Body.

But the question is - how to go from this (renaming-as-)body (which
plays the role of a body) to the (corresponding!) declaqration
of Foo?

The documentation of Asis.Declarations.Corresponding_Declaration says,
that for A_Function_Renaming_Declaration and A_Procedure_Renaming_Declaration
*the argument Declaration should be returned, but it means, that this
query does not make any difference between renaming-as-declaration and
renaming-as-body.

Did I miss something important? If I did not, it looks like there is
a bug in the ASIS definition, and Asis.Declarations.Corresponding_Declaration
should return the *argument Declaration* for renaming-as-declaration, and
it should return the *corresponding subprogram declaration* for
renaming-as-body.

!resolution  Accept, as Modified.
!date 97-05-28
!Notes

ASIS should make the difference between renaming-as-declaration and
renaming-as-body in Asis.Declarations.Corresponding_Declaration.
Otherwise (as it stands now) ASIS does not give any natural means to
go from renaminmg-as-body to the subprogram declaration for which this
renaming-as-body is a completion.

The following changes were made to ASIS version 2.0.N in the
definition of Asis.Declarations.Corresponding_Declaration (15.26):

-- If a subprogram renaming declaration is given:
--
--    a) in case of renaming-as-declaration, the same element is returned;
--    b) in case of renaming-as-body, the subprogram declaration completed
--       by this subprogram renaming declaration is returned.
--       (Reference Manual, 8.5.4(1))

...

Add to the list of Appropriate Declaration_Kinds returning a
specification:

      A_Function_Renaming_Declaration (renaming-as-body)
      A_Procedure_Renaming_Declaration (renaming-as-body)

Add to the list of Appropriate Declaration_Kinds returning the
argument Declaration:

      A_Function_Renaming_Declaration (renaming-as-declaration)
      A_Procedure_Renaming_Declaration (renaming-as-declaration)

See also Issue #076.
