summaryrefslogtreecommitdiff
path: root/gcc/ada/aspects.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/aspects.adb')
-rwxr-xr-xgcc/ada/aspects.adb14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 48a1c89e700..9b707734b76 100755
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -127,7 +127,19 @@ package body Aspects is
Ritem : Node_Id;
begin
- Ritem := First_Rep_Item (Ent);
+
+ -- If the aspect is an inherited one and the entity is a class-wide
+ -- type, use the aspect of the specific type.
+
+ if Is_Type (Ent)
+ and then Is_Class_Wide_Type (Ent)
+ and then Inherited_Aspect (A)
+ then
+ Ritem := First_Rep_Item (Etype (Ent));
+ else
+ Ritem := First_Rep_Item (Ent);
+ end if;
+
while Present (Ritem) loop
if Nkind (Ritem) = N_Aspect_Specification
and then Get_Aspect_Id (Chars (Identifier (Ritem))) = A