diff mbox

[Ada] Allow Linker_Section for types

Message ID 20131010103808.GA17579@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Oct. 10, 2013, 10:38 a.m. UTC
This is the front end part of the work for allowing Linker_Section
for types. No test filed yet, waiting for completion of required
back end (gigi) work.

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-10-10  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case Linker_Section): Allow
	this for types.
diff mbox

Patch

Index: sem_prag.adb
===================================================================
--- sem_prag.adb	(revision 203342)
+++ sem_prag.adb	(working copy)
@@ -13736,10 +13736,13 @@ 
             Check_Arg_Is_Library_Level_Local_Name (Arg1);
             Check_Arg_Is_Static_Expression (Arg2, Standard_String);
 
-            --  This pragma applies only to objects
+            --  This pragma applies to objects and types
 
-            if not Is_Object (Entity (Get_Pragma_Arg (Arg1))) then
-               Error_Pragma_Arg ("pragma% applies only to objects", Arg1);
+            if not Is_Object (Entity (Get_Pragma_Arg (Arg1)))
+              and then not Is_Type (Entity (Get_Pragma_Arg (Arg1)))
+            then
+               Error_Pragma_Arg
+                 ("pragma% applies only to objects and types", Arg1);
             end if;
 
             --  The only processing required is to link this item on to the