[Ada] Accept aspect Relaxed_Initialization on generic subprograms
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 15 May 2020 13:11:18 +0000 (15:11 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 8 Jul 2020 14:55:53 +0000 (10:55 -0400)
commit720425fa2dca0b7a69e28b1853932d5a77bf9333
treeacd28f40999e21e93a6f512d2f5df368b1921046
parent6b52c24dd1870aff68879bd68a67fdb14f7e5cba
[Ada] Accept aspect Relaxed_Initialization on generic subprograms

gcc/ada/

* sem_attr.adb (Analyze_Attribute): Correct prefix of 'Result
this prefix is a generic function but the enclosing aspect or
pragma is attached to its instance.
* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Analyze
generic subprogram formal parameters (including the implicit
result of a generic function) and only then analyse its aspects,
because with Relaxed_Initialization the aspect expression might
refer to those formal parameters.
* sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): Accept
aspect on generic subprograms; install formal parameters of a
generic subprogram but not formal parameters of the generic unit
itself (the previous code was inspired by aspects Post and
Depends, where both kinds of formals are allowed).
* sem_util.ads (Enter_Name): Fix name of a subprogram referenced
in comment.
gcc/ada/sem_attr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_util.ads