[Ada] Stubs that complete generic subprogram do have a "prior declaration"
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 11 Dec 2018 11:10:22 +0000 (11:10 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 11 Dec 2018 11:10:22 +0000 (11:10 +0000)
commitf3e0577c2a2d3463ec8e05ec187ed7ad4f906159
treef8bfbc39d5b819fdaa1b66fbc3a8fd298c0eb302
parent60c14ec73cb0a9fbff8e49e4a94f8b59236225e0
[Ada] Stubs that complete generic subprogram do have a "prior declaration"

The intuition behind the Is_Subprogram_Stub_Without_Prior_Declaration
utility routine is to detect stubs that act as subprogram declarations
and False on stubs that act as completions. This behaviour is now fixed
for stubs that correspond to generic subprogram declarations.

This patch affects a routine that is only used in GNATprove, so no
frontend test provided. An example where the result changed from True to
False is:

-----------
-- p.ads --
-----------

package P is
   generic
   procedure Proc;
end P;

-----------
-- p.adb --
-----------

package body P is
   procedure Proc is separate; -- now we return False for this stub
end P;

----------------
-- p-proc.adb --
----------------

separate (P)
procedure Proc is
begin
   null;
end;

2018-12-11  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_util.adb (Is_Subprogram_Stub_Without_Prior_Declaration):
Return False on stubs that complete a generic subprogram.
* sem_util.ads: Update corresponding comment.

From-SVN: r266992
gcc/ada/ChangeLog
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads