]> gcc.gnu.org Git - gcc.git/commit
ada: Adjust classwide contract expression preanalysis
authorRonan Desplanques <desplanques@adacore.com>
Mon, 24 Oct 2022 09:50:06 +0000 (11:50 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 8 Nov 2022 08:35:02 +0000 (09:35 +0100)
commit45656a992eb18bfefe2e6e20d3b425afe945af28
treea72c8da1b7fce47af8249b860cd94deebff9711f
parent48e2e5b4c2f56b9e3497d57d0974c66604e087a6
ada: Adjust classwide contract expression preanalysis

Before this patch, a classwide contract expression was preanalyzed
only when its primitive operation's type was frozen. It caused name
resolution to be off in the cases where the freezing took place
after the end of the declaration list the primitive operation was
declared in.

This patch makes it so that if the compiler gets to the end of
the declaration list before the type is frozen, it preanalyzes the
classwide contract expression, so that the names are resolved in the
right context.

gcc/ada/

* contracts.adb
(Preanalyze_Class_Conditions): New procedure.
(Preanalyze_Condition): Moved out from Merge_Class_Conditions in
order to be spec-visible.
* contracts.ads
(Preanalyze_Class_Conditions): New procedure.
* sem_prag.adb
(Analyze_Pre_Post_Condition_In_Decl_Part): Call
Preanalyze_Class_Conditions when necessary.
gcc/ada/contracts.adb
gcc/ada/contracts.ads
gcc/ada/sem_prag.adb
This page took 0.065472 seconds and 6 git commands to generate.