diff options
author | Javier Miranda <miranda@adacore.com> | 2019-12-13 09:05:28 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-13 09:05:28 +0000 |
commit | c90e1eca3782b667c081e08dad03aee5b4f16276 (patch) | |
tree | feac080fee7ac02c28a6cb9c04f4c1504b5d9433 /gcc/ada | |
parent | e1e1e53a4861f5addee43088de14dadf47892f23 (diff) | |
download | gcc-c90e1eca3782b667c081e08dad03aee5b4f16276.zip gcc-c90e1eca3782b667c081e08dad03aee5b4f16276.tar.gz gcc-c90e1eca3782b667c081e08dad03aee5b4f16276.tar.bz2 |
[Ada] Spurious error on precondition of subprogram instantiation
2019-12-13 Javier Miranda <miranda@adacore.com>
gcc/ada/
* sem_ch13.adb (Analyze_Aspect_Specification): Processing a
precondition, if the expression is of the form A and then B, do
not generate separate Pre/Post aspects for the separate clases
when we are processing a generic unit. Required to avoid
reporting spurious visibility errors on the instantiations.
From-SVN: r279365
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7282db4..bfc9be1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2019-12-13 Javier Miranda <miranda@adacore.com> + + * sem_ch13.adb (Analyze_Aspect_Specification): Processing a + precondition, if the expression is of the form A and then B, do + not generate separate Pre/Post aspects for the separate clases + when we are processing a generic unit. Required to avoid + reporting spurious visibility errors on the instantiations. + 2019-12-13 Eric Botcazou <ebotcazou@adacore.com> * sem_res.adb (Resolve_Actuals): Give canonical error for diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index b2b9efa..e266af9 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3479,11 +3479,14 @@ package body Sem_Ch13 is -- don't do this in GNATprove mode, because it brings no -- benefit for proof and causes annoynace for flow analysis, -- which prefers to be as close to the original source code - -- as possible. + -- as possible. Also we don't do this when analyzing generic + -- units since it causes spurious visibility errors in the + -- preanalysis of instantiations. if not (ASIS_Mode or GNATprove_Mode) and then (Pname = Name_Postcondition or else not Class_Present (Aspect)) + and then not Inside_A_Generic then while Nkind (Expr) = N_And_Then loop Insert_After (Aspect, |