Commit c90e1eca by Javier Miranda Committed by Pierre-Marie de Rodat

[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
parent e1e1e53a
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> 2019-12-13 Eric Botcazou <ebotcazou@adacore.com>
* sem_res.adb (Resolve_Actuals): Give canonical error for * sem_res.adb (Resolve_Actuals): Give canonical error for
......
...@@ -3479,11 +3479,14 @@ package body Sem_Ch13 is ...@@ -3479,11 +3479,14 @@ package body Sem_Ch13 is
-- don't do this in GNATprove mode, because it brings no -- don't do this in GNATprove mode, because it brings no
-- benefit for proof and causes annoynace for flow analysis, -- benefit for proof and causes annoynace for flow analysis,
-- which prefers to be as close to the original source code -- 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) if not (ASIS_Mode or GNATprove_Mode)
and then (Pname = Name_Postcondition and then (Pname = Name_Postcondition
or else not Class_Present (Aspect)) or else not Class_Present (Aspect))
and then not Inside_A_Generic
then then
while Nkind (Expr) = N_And_Then loop while Nkind (Expr) = N_And_Then loop
Insert_After (Aspect, Insert_After (Aspect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment