aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-05-21 00:58:06 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-08 10:55:54 -0400
commit1567ebf93abda477cf1d7e1f88d89cd0b875a1b6 (patch)
treeb261a112c0e56dfeab8a1f52411366c4b4c65144 /gcc
parent98ceb79632938c5dfa74dbf4c84854c0bba5e75a (diff)
downloadgcc-1567ebf93abda477cf1d7e1f88d89cd0b875a1b6.zip
gcc-1567ebf93abda477cf1d7e1f88d89cd0b875a1b6.tar.gz
gcc-1567ebf93abda477cf1d7e1f88d89cd0b875a1b6.tar.bz2
[Ada] Fix incorrect placement of freeze node with predicate
gcc/ada/ * freeze.adb (In_Expanded_Body): Return true for the body of a generated predicate function.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/freeze.adb17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 528a7dd..33eefb2 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -7054,11 +7054,11 @@ package body Freeze is
-- as well.
function In_Expanded_Body (N : Node_Id) return Boolean;
- -- Given an N_Handled_Sequence_Of_Statements node N, determines whether
- -- it is the handled statement sequence of an expander-generated
- -- subprogram: init proc, stream subprogram, renaming as body, or body
- -- created for an expression function. If so, this is not a freezing
- -- context and the entity will be frozen at a later point.
+ -- Given an N_Handled_Sequence_Of_Statements node, determines whether it
+ -- is the statement sequence of an expander-generated subprogram: body
+ -- created for an expression function, for a predicate function, an init
+ -- proc, a stream subprogram, or a renaming as body. If so, this is not
+ -- a freezing context and the entity will be frozen at a later point.
-----------------------------------------
-- Find_Aggregate_Component_Desig_Type --
@@ -7112,6 +7112,13 @@ package body Freeze is
elsif Was_Expression_Function (P) then
return not Comes_From_Source (P);
+ -- This is the body of a generated predicate function
+
+ elsif Present (Corresponding_Spec (P))
+ and then Is_Predicate_Function (Corresponding_Spec (P))
+ then
+ return True;
+
else
Id := Defining_Unit_Name (Specification (P));