diff options
author | Ed Schonberg <schonberg@adacore.com> | 2020-06-15 17:40:26 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-27 04:05:16 -0400 |
commit | 79926e5a904598f638dc258d727babfcda28c0ac (patch) | |
tree | 523a83ad1c89ca8ac2f0495edd7e635a6bf2cf93 | |
parent | faa163f737cb388f97a285be28060730abd460a0 (diff) | |
download | gcc-79926e5a904598f638dc258d727babfcda28c0ac.zip gcc-79926e5a904598f638dc258d727babfcda28c0ac.tar.gz gcc-79926e5a904598f638dc258d727babfcda28c0ac.tar.bz2 |
[Ada] Warnings on overloays involving generic In_Parameters
gcc/ada/
* sem_ch13.adb (Analyze_Address_Specification_Clause): Do not
emit a warning when a constant declaration in a generic unit
overlays a generic In_Parameter.
-rw-r--r-- | gcc/ada/sem_ch13.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index ec25e3d..6927d54 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -6190,9 +6190,13 @@ package body Sem_Ch13 is -- Issue an unconditional warning for a constant overlaying -- a variable. For the reverse case, we will issue it only -- if the variable is modified. + -- Within a generic unit an In_Parameter is a constant. + -- It can be instantiated with a variable, in which case + -- there will be a warning on the instance. if Ekind (U_Ent) = E_Constant and then Present (O_Ent) + and then Ekind (O_Ent) /= E_Generic_In_Parameter and then not Overlays_Constant (U_Ent) and then Address_Clause_Overlay_Warnings then |