+2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_prag.adb (Is_Before_First_Decl): Deal with rewritten
+ pragmas.
+
2019-08-19 Bob Duff <duff@adacore.com>
* sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
Item : Node_Id := First (Decls);
begin
- -- Only other pragmas can come before this pragma
+ -- Only other pragmas can come before this pragma, but they might
+ -- have been rewritten so check the original node.
loop
- if No (Item) or else Nkind (Item) /= N_Pragma then
+ if No (Item) or else Nkind (Original_Node (Item)) /= N_Pragma then
return False;
elsif Item = Pragma_Node then
+2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/elab8.adb, gnat.dg/elab8_gen.adb,
+ gnat.dg/elab8_gen.ads, gnat.dg/elab8_pkg.adb,
+ gnat.dg/elab8_pkg.ads: New testcase.
+
2019-08-19 Bob Duff <duff@adacore.com>
* gnat.dg/warn29.adb, gnat.dg/warn29.ads: New testcase.
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatN" }
+
+with Elab8_Gen;
+
+procedure Elab8 is
+
+ package My_G is new Elab8_Gen (Integer);
+
+begin
+ My_G.Compare (0, 1);
+end;
--- /dev/null
+with Elab8_Pkg;
+
+package body Elab8_Gen is
+
+ procedure Compare (Arg1, Arg2 : T) is
+ begin
+ if Arg1 = Arg2 then
+ raise Program_Error;
+ end if;
+ end;
+
+end Elab8_Gen;
--- /dev/null
+generic
+ type T is private;
+package Elab8_Gen is
+
+ procedure Compare (Arg1, Arg2 : T);
+ pragma Inline (Compare);
+
+end Elab8_Gen;
--- /dev/null
+package body Elab8_Pkg is
+
+ procedure Dummy is null;
+
+end Elab8_Pkg;
--- /dev/null
+package Elab8_Pkg with SPARK_Mode is
+
+ pragma Elaborate_Body;
+
+end Elab8_Pkg;