]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tweak caching of streaming subprograms
authorRonan Desplanques <desplanques@adacore.com>
Fri, 31 Jan 2025 09:40:42 +0000 (10:40 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 5 Jun 2025 08:18:37 +0000 (10:18 +0200)
gcc/ada/ChangeLog:

* exp_attr.adb (Interunit_Ref_OK): Tweak categorization of compilation
units.

gcc/ada/exp_attr.adb

index aea9e8ad3afd27f59f4da5e5e2fa8b3b6cd7f988..4e0052e9ee417ec716aee0f6adb63bfb6c7d7c0e 100644 (file)
@@ -284,8 +284,8 @@ package body Exp_Attr is
        (In_Same_Extended_Unit (Subp_Unit, Attr_Ref_Unit)
          --  If subp declared in unit body, then we don't want to refer
          --  to it from within unit spec so return False in that case.
-         and then not (Body_Required (Attr_Ref_Unit)
-                       and not Body_Required (Subp_Unit)));
+         and then not (not Is_Body (Unit (Attr_Ref_Unit))
+                       and Is_Body (Unit (Subp_Unit))));
    --  Returns True if it is ok to refer to a cached subprogram declared in
    --  Subp_Unit from the point of an attribute reference occurring in
    --  Attr_Ref_Unit. Both arguments are usually N_Compilation_Nodes,