[Ada] Do not overwrite limited view of result type
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 19 Feb 2022 11:30:47 +0000 (12:30 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 13 May 2022 08:04:34 +0000 (08:04 +0000)
commit85df62468c26335d7d771f319620f7a51f58e448
treeec6a9b944f4ca04a7974908bd11a022396f17a92
parent18e278727e1a0430f50e878dbfadb35dae54baff
[Ada] Do not overwrite limited view of result type

This removes obsolete code that overwrites a limited view present as the
result type of a function during the tentative analysis of prefixed
views for function calls involving tagged types. The original view is
necessary for the code generator to break the circularity present in
this setup.

The change also adds a couple of guards for the illegal case where the
limited view is the only view available when the function is invoked.

gcc/ada/

* aspects.adb (Find_Value_Of_Aspect): Add guard.
* sem_ch4.adb (Complete_Object_Operation): Remove obsolete code.
* sem_ch5.adb (Has_Sec_Stack_Default_Iterator): Add guard.
gcc/ada/aspects.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch5.adb