]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ada: Fix bogus error for 'Unrestricted_Access of overloaded subprogram
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 30 Jul 2026 16:29:51 +0000 (18:29 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 30 Jul 2026 16:31:07 +0000 (18:31 +0200)
This plugs an old loophole in Analyze_Attribute for the handling of the
GNAT specific Unrestricted_Access attribute.

gcc/ada/
PR ada/126482
* sem_attr.adb (Analyze_Attribute): Treat Unrestricted_Access like
[Unchecked_]Access when it comes to the overloading of the prefix.

gcc/ada/sem_attr.adb

index 7ef0145e872249285d131804cf9d69b645790531..7180ab813143813f6bbede01307978c8c2e4660b 100644 (file)
@@ -3527,6 +3527,7 @@ package body Sem_Attr is
         and then Aname /= Name_Code_Address
         and then Aname /= Name_Result
         and then Aname /= Name_Unchecked_Access
+        and then Aname /= Name_Unrestricted_Access
       then
          --  The prefix must be resolvable by itself, without reference to the
          --  attribute. One case that requires special handling is a prefix