public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-939] [Ada] Fix detection of deferred constants for freezing error
@ 2022-06-02  9:09 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-06-02  9:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b25912a4138026ccbb1efd7b680075a0953ac074

commit r13-939-gb25912a4138026ccbb1efd7b680075a0953ac074
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu May 12 17:44:59 2022 +0200

    [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.

Diff:
---
 gcc/ada/freeze.adb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index f4ebf300a19..b7310a4e8a8 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));


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  9:09 [gcc r13-939] [Ada] Fix detection of deferred constants for freezing error Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).