aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 8d716aa..165df61 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -13736,10 +13736,13 @@ package body Sem_Prag is
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