aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-06-22 06:18:14 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-15 05:39:09 -0400
commit96ece83775334d8125c16c4c3dcc607b511bc7b2 (patch)
treeab97e50c5bc3f621cf7b17c658d1a23970baa88f /gcc
parent73b211a76e4da53960958b8a4b3821de82a3219c (diff)
downloadgcc-96ece83775334d8125c16c4c3dcc607b511bc7b2.zip
gcc-96ece83775334d8125c16c4c3dcc607b511bc7b2.tar.gz
gcc-96ece83775334d8125c16c4c3dcc607b511bc7b2.tar.bz2
[Ada] Double evaluation of predicate
gcc/ada/ * sem_ch13.adb (Add_Predicates): Prevent analyzing twice the same pragma in case an inner package references the type with a predicate (as opposed to defining the type).
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch13.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 28fd1ed..a322466f 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -9746,7 +9746,7 @@ package body Sem_Ch13 is
elsif Nkind (Ritem) = N_Aspect_Specification
and then Present (Aspect_Rep_Item (Ritem))
- and then Scope (Typ) /= Current_Scope
+ and then Scope_Depth (Scope (Typ)) > Scope_Depth (Current_Scope)
then
declare
Prag : constant Node_Id := Aspect_Rep_Item (Ritem);