return;
end if;
- Id := Identifier (N);
+ if Nkind (N) = N_Pragma then
+ Id := Pragma_Identifier (N);
+ elsif Nkind (N) = N_Attribute_Definition_Clause then
+ Id := N;
+ else
+ Id := Identifier (N);
+ end if;
+
A_Id := Get_Aspect_Id (Chars (Id));
pragma Assert (A_Id /= No_Aspect);
-- the node to which an error will be attached if necessary.
procedure Check_Restriction_No_Specification_Of_Aspect (N : Node_Id);
- -- N is the node id for an N_Aspect_Specification. An error message
- -- (warning) will be issued if a restriction (warning) was previously set
- -- for this aspect using Set_No_Specification_Of_Aspect.
+ -- N is the node id for an N_Aspect_Specification, an N_Pragma, or an
+ -- N_Attribute_Definition_Clause. An error message (warning) will be issued
+ -- if a restriction (warning) was previously set for this aspect using
+ -- Set_No_Specification_Of_Aspect.
procedure Check_Restriction_No_Use_Of_Attribute (N : Node_Id);
-- N denotes an attribute definition clause or an attribute reference. An
Check_Restriction_No_Use_Of_Attribute (N);
+ if Get_Aspect_Id (Chars (N)) /= No_Aspect then
+ -- 6.1/3 No_Specification_of_Aspect: Identifies an aspect for which
+ -- no aspect_specification, attribute_definition_clause, or pragma
+ -- is given.
+ Check_Restriction_No_Specification_Of_Aspect (N);
+ end if;
+
-- Ignore some selected attributes in CodePeer mode since they are not
-- relevant in this context.
Check_Restriction_No_Use_Of_Pragma (N);
+ if Get_Aspect_Id (Chars (Pragma_Identifier (N))) /= No_Aspect then
+ -- 6.1/3 No_Specification_of_Aspect: Identifies an aspect for which
+ -- no aspect_specification, attribute_definition_clause, or pragma
+ -- is given.
+ Check_Restriction_No_Specification_Of_Aspect (N);
+ end if;
+
-- Ignore pragma if Ignore_Pragma applies. Also ignore pragma
-- Default_Scalar_Storage_Order if the -gnatI switch was given.