2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Do not set force_global
+ for imported subprograms.
+
+2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Do not make
constant objects covered by 13.3(19) volatile.
another compilation unit) public entities, show we are at global level
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. 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)))
+ being defined. */
+ if (!definition
+ && Is_Public (gnat_entity)
+ && !Is_Statically_Allocated (gnat_entity)
+ && kind != E_Component
+ && kind != E_Discriminant)
force_global++, this_global = true;
/* Handle any attributes directly attached to the entity. */
+2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/import1.ad[sb]: New test.
+
2009-04-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
- * objc/execute/exceptions/handler-1.m: For the NeXT runtime, just return 0.
+ * objc/execute/exceptions/handler-1.m: For the NeXT runtime, just
+ return 0.
2009-04-20 Tobias Burnus <burnus@net-b.de>
--- /dev/null
+-- { dg-do compile }\r
+-- { dg-options "-g" }\r
+\r
+package body Import1 is\r
+\r
+ procedure Create (Bounds : Arr) is\r
+ type Bound_Array is array (Bounds'Range) of Integer;\r
+\r
+ procedure Proc (Ptr : access Bound_Array);\r
+ pragma Import (C, Proc);\r
+\r
+ Temp : aliased Bound_Array;\r
+ begin\r
+ Proc (Temp'Access);\r
+ end;\r
+\r
+end Import1;\r
--- /dev/null
+package Import1 is\r
+\r
+ type Arr is array (Positive range <>) of Integer;\r
+\r
+ procedure Create (Bounds : Arr);\r
+\r
+end Import1;\r