]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Spurious warning when using 'Type_Key on generic formal
authorJustin Squirek <squirek@adacore.com>
Tue, 16 Nov 2021 15:50:06 +0000 (10:50 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Dec 2021 10:24:41 +0000 (10:24 +0000)
gcc/ada/

* sem_attr.adb (Type_Key): Avoid premature use warnings when the
prefix is a generic actual.

gcc/ada/sem_attr.adb

index 2575ddfe86d710ee947f3aad303b7ec2ed31288a..ef7437a0dd0d87c53117c8ef1661c7a8a0ed8c0f 100644 (file)
@@ -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;