public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5671] [Ada] Spurious warning when using 'Type_Key on generic formal
Date: Wed,  1 Dec 2021 10:26:35 +0000 (GMT)	[thread overview]
Message-ID: <20211201102635.894203858416@sourceware.org> (raw)

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

commit r12-5671-gb940999de44208a0659d9441393fa3f62be24f28
Author: Justin Squirek <squirek@adacore.com>
Date:   Tue Nov 16 10:50:06 2021 -0500

    [Ada] Spurious warning when using 'Type_Key on generic formal
    
    gcc/ada/
    
            * sem_attr.adb (Type_Key): Avoid premature use warnings when the
            prefix is a generic actual.

Diff:
---
 gcc/ada/sem_attr.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 2575ddfe86d..ef7437a0dd0 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -6664,6 +6664,7 @@ package body Sem_Attr is
 
          if not Is_Frozen (Entity (P))
            and then not Is_Generic_Type (Entity (P))
+           and then not Is_Generic_Actual_Type (Entity (P))
          then
             Error_Msg_N ("premature usage of Type_Key?", N);
          end if;


                 reply	other threads:[~2021-12-01 10:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201102635.894203858416@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).