aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-09-26 22:54:12 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-10-10 14:12:28 +0200
commit6bd83c90191a512d2c9094623248219d610b4372 (patch)
treec8496f76fb358b205fc35d3aa60742efe3b049ef /gcc/fold-const.cc
parent34992e156b6a4d737440e675b86cd2f8ac103363 (diff)
downloadgcc-6bd83c90191a512d2c9094623248219d610b4372.zip
gcc-6bd83c90191a512d2c9094623248219d610b4372.tar.gz
gcc-6bd83c90191a512d2c9094623248219d610b4372.tar.bz2
ada: Fix infinite loop with multiple limited with clauses
This occurs when one of the types has an incomplete declaration in addition to its full declaration in its package. In this case AI05-129 says that the incomplete type is not part of the limited view of the package, i.e. only the full view is. Now, in the GNAT implementation, it's the opposite in the regular view of the package, i.e. the incomplete type is the visible one. That's why the implementation needs to also swap the types on the visibility chain while it is swapping the views when the clauses are either installed or removed. This works correctly for the installation, but does not for the removal, so this change rewrites the code doing the latter. gcc/ada/ PR ada/111434 * sem_ch10.adb (Replace): New procedure to replace an entity with another on the homonym chain. (Install_Limited_With_Clause): Rename Non_Lim_View to Typ for the sake of consistency. Call Replace to do the replacements and split the code into the regular and the special cases. Add debuggging output controlled by -gnatdi. (Install_With_Clause): Print the Parent_With and Implicit_With flags in the debugging output controlled by -gnatdi. (Remove_Limited_With_Unit.Restore_Chain_For_Shadow (Shadow)): Rewrite using a direct replacement of E4 by E2. Call Replace to do the replacements. Add debuggging output controlled by -gnatdi.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions