]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Overridden operation field not correctly set for controlling result wrappers
authorMartin Clochard <clochard@adacore.com>
Fri, 7 Jun 2024 09:44:45 +0000 (11:44 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 27 Jun 2024 08:19:12 +0000 (10:19 +0200)
commit60ca71044e8e4d492c74f65f6093fbcf46d238bb
treeebad5d5f90bcd3da323086c57d3f539d30dd5514
parent3cb7e22ad965bbbb672f51a437c0a30a4c95f558
ada: Overridden operation field not correctly set for controlling result wrappers

Implicit wrapper overridings generated for functions with
controlling result when deriving with null extension may
have field Overridden_Operation incorrectly set, when making
several such derivations in succession. This happens because
overridings were assumed to come from source, and entities
generated by Derive_Subprograms were also assumed to be
derived from source subprograms. Overridden_Operation could
be set to the entity generated by Derive_Subprograms for the
same type, resulting in a cycle between Overriden_Operation
and Alias fields, causing non-termination in GNATprove.

gcc/ada/

* sem_ch6.adb (Check_Overriding_Indicator) Remove Comes_From_Source filter.
(New_Overloaded_Entity) Move up special case of LSP_Subprogram,
and remove Comes_From_Source filter.
gcc/ada/sem_ch6.adb