ada: Fix spurious error on nested instantiations with generic renaming
commitbf25f6fc571c0f3b1ca1c70106730104ea91c65a
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 1 Apr 2023 19:57:21 +0000 (1 21:57 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 29 May 2023 08:23:18 +0000 (29 10:23 +0200)
tree32320650bc5eef9f2cb1cd09d48b167ca0ce5dc6
parentdedcfceaf012675d5c5c4f34a7cd97d23357d3f3
ada: Fix spurious error on nested instantiations with generic renaming

The problem is that the renaming slightly changes the form of a global
reference that was saved during the analysis of a generic package, and
that is sufficient to fool the code adjusting global references during
the instantiation.

gcc/ada/

* sem_ch12.adb (Copy_Generic_Node): Test the original node kind
for the sake of consistency.  For identifiers and other entity
names and operators, accept an expanded name as associated node.
Replace "or" with "or else" in condtion and fix its formatting.
gcc/ada/sem_ch12.adb