ada: Fix handling of Global contracts inside generic subprograms
Routine Get_Argument works differently for generic units (as explained
in its comment), but it failed to reliably detect such units when their
kind is temporarily made non-generic (for resolving recursive calls, as
explained in the comment at the end of Is_Generic_Declaration_Or_Body).
With this patch the frontend will look at the decorated expression of
the Global contract attached to the Global aspect; previously it was
looking at the undecorated expression attached to the corresponding
pragma.
gcc/ada/
* sem_prag.adb (Get_Argument): Improve detection of generic units.