diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2022-10-17 12:00:09 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-08 09:34:59 +0100 |
commit | 788e5f06d4e804dcc9e255fa448ba0c3db1586c4 (patch) | |
tree | c22a53c565ffd37dabff388459d5926c29ed7104 /gcc/ada/contracts.adb | |
parent | c2596d4533389b8898516b444f8464a1720711af (diff) | |
download | gcc-788e5f06d4e804dcc9e255fa448ba0c3db1586c4.zip gcc-788e5f06d4e804dcc9e255fa448ba0c3db1586c4.tar.gz gcc-788e5f06d4e804dcc9e255fa448ba0c3db1586c4.tar.bz2 |
ada: Preanalyze classwide contracts as spec expressions
Classwide contracts are "spec expressions" as defined in the
documentation in sem.ads. Before this patch, the instances of
classwide contracts that are destined to class conditions merging
were not preanalyzed as spec expressions. That caused preanalysis to
emit spurious errors in some cases.
gcc/ada/
* contracts.adb (Preanalyze_Condition): Use
Preanalyze_Spec_Expression.
Diffstat (limited to 'gcc/ada/contracts.adb')
-rw-r--r-- | gcc/ada/contracts.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index a300d73..21f438f 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -42,13 +42,13 @@ with Nmake; use Nmake; with Opt; use Opt; with Sem; use Sem; with Sem_Aux; use Sem_Aux; +with Sem_Ch3; use Sem_Ch3; with Sem_Ch6; use Sem_Ch6; with Sem_Ch8; use Sem_Ch8; with Sem_Ch12; use Sem_Ch12; with Sem_Ch13; use Sem_Ch13; with Sem_Disp; use Sem_Disp; with Sem_Prag; use Sem_Prag; -with Sem_Res; use Sem_Res; with Sem_Type; use Sem_Type; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; @@ -4755,7 +4755,7 @@ package body Contracts is Install_Formals (Subp); Inside_Class_Condition_Preanalysis := True; - Preanalyze_And_Resolve (Expr, Standard_Boolean); + Preanalyze_Spec_Expression (Expr, Standard_Boolean); Inside_Class_Condition_Preanalysis := False; Remove_Formals (Subp); |