https://gcc.gnu.org/g:700f14ab3240d4ea1b594976f6a0c278581df7d9

commit r16-1155-g700f14ab3240d4ea1b594976f6a0c278581df7d9
Author: Ronan Desplanques <desplanq...@adacore.com>
Date:   Fri Jan 31 10:40:42 2025 +0100

    ada: Tweak caching of streaming subprograms
    
    gcc/ada/ChangeLog:
    
            * exp_attr.adb (Interunit_Ref_OK): Tweak categorization of 
compilation
            units.

Diff:
---
 gcc/ada/exp_attr.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index aea9e8ad3afd..4e0052e9ee41 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -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,

Reply via email to