===================================================================
@@ -3466,9 +3466,9 @@
------------------------------------------
procedure Analyze_Generic_Package_Declaration (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Decls : constant List_Id :=
- Visible_Declarations (Specification (N));
+ Decls : constant List_Id := Visible_Declarations (Specification (N));
+ Loc : constant Source_Ptr := Sloc (N);
+
Decl : Node_Id;
Id : Entity_Id;
New_N : Node_Id;
@@ -3492,9 +3492,20 @@
Name =>
Make_Identifier (Loc, Chars (Defining_Entity (N))));
+ -- The declaration is inserted before other declarations, but before
+ -- pragmas that may be library-unit pragmas and must appear before other
+ -- declarations. The pragma Compile_Time_Error is not in this class, and
+ -- may contain an expression that includes such a qualified name, so the
+ -- renaming declaration must appear before it.
+
+ -- Are there other pragmas that require this special handling ???
+
if Present (Decls) then
Decl := First (Decls);
- while Present (Decl) and then Nkind (Decl) = N_Pragma loop
+ while Present (Decl)
+ and then Nkind (Decl) = N_Pragma
+ and then Get_Pragma_Id (Decl) /= Pragma_Compile_Time_Error
+ loop
Next (Decl);
end loop;