aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-05-12 17:44:59 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-06-02 09:06:40 +0000
commitb25912a4138026ccbb1efd7b680075a0953ac074 (patch)
treeecf3ad3c31e9e0fb706ae7345fb7dba36e3b03d3 /gcc
parentcfd2262668862167cbe102ffbe87f127599be7a8 (diff)
downloadgcc-b25912a4138026ccbb1efd7b680075a0953ac074.zip
gcc-b25912a4138026ccbb1efd7b680075a0953ac074.tar.gz
gcc-b25912a4138026ccbb1efd7b680075a0953ac074.tar.bz2
[Ada] Fix detection of deferred constants for freezing error
Testing Is_Frozen is not robust enough, so instead test that the full view has been seen and that the Has_Completion flag is set on it. gcc/ada/ * freeze.adb (Check_Expression_Function.Find_Constant): Make test for deferred constants more robust.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/freeze.adb3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index f4ebf30..b7310a4 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -1458,7 +1458,8 @@ package body Freeze is
N_Object_Declaration
and then not Is_Imported (Entity (Nod))
and then not Has_Completion (Entity (Nod))
- and then not Is_Frozen (Entity (Nod))
+ and then not (Present (Full_View (Entity (Nod)))
+ and then Has_Completion (Full_View (Entity (Nod))))
then
Error_Msg_NE
("premature use of& in call or instance", N, Entity (Nod));