diff options
Diffstat (limited to 'gcc/ada/decl.c')
| -rw-r--r-- | gcc/ada/decl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 41d405a47d4..3f5d80939fb 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -299,12 +299,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* For cases when we are not defining (i.e., we are referencing from another compilation unit) Public entities, show we are at global level - for the purpose of computing sizes. Don't do this for components or + for the purpose of computing scopes. Don't do this for components or discriminants since the relevant test is whether or not the record is - being defined. */ - if (! definition && Is_Public (gnat_entity) - && ! Is_Statically_Allocated (gnat_entity) - && kind != E_Discriminant && kind != E_Component) + being defined. But do this for Imported functions or procedures in + all cases. */ + if ((! definition && Is_Public (gnat_entity) + && ! Is_Statically_Allocated (gnat_entity) + && kind != E_Discriminant && kind != E_Component) + || (Is_Imported (gnat_entity) + && (kind == E_Function || kind == E_Procedure))) force_global++, this_global = 1; /* Handle any attributes. */ |

