===================================================================
@@ -6635,15 +6635,20 @@
Attribute_Name => Name_Tag);
end if;
- Insert_Action (Exp,
- Make_Raise_Program_Error (Loc,
- Condition =>
- Make_Op_Gt (Loc,
- Left_Opnd => Build_Get_Access_Level (Loc, Tag_Node),
- Right_Opnd =>
- Make_Integer_Literal (Loc,
- Scope_Depth (Enclosing_Dynamic_Scope (Scope_Id)))),
- Reason => PE_Accessibility_Check_Failed));
+ if not CodePeer_Mode then
+ -- CodePeer doesn't do anything useful with
+ -- Ada.Tags.Type_Specific_Data components
+
+ Insert_Action (Exp,
+ Make_Raise_Program_Error (Loc,
+ Condition =>
+ Make_Op_Gt (Loc,
+ Left_Opnd => Build_Get_Access_Level (Loc, Tag_Node),
+ Right_Opnd =>
+ Make_Integer_Literal (Loc,
+ Scope_Depth (Enclosing_Dynamic_Scope (Scope_Id)))),
+ Reason => PE_Accessibility_Check_Failed));
+ end if;
end;
-- AI05-0073: If function has a controlling access result, check that
===================================================================
@@ -421,20 +421,22 @@
Result_Typ := Class_Wide_Type (Etype (Act_Constr));
-- Check that the accessibility level of the tag is no deeper than that
- -- of the constructor function.
+ -- of the constructor function (unless CodePeer_Mode)
- Insert_Action (N,
- Make_Implicit_If_Statement (N,
- Condition =>
- Make_Op_Gt (Loc,
- Left_Opnd =>
- Build_Get_Access_Level (Loc, New_Copy_Tree (Tag_Arg)),
- Right_Opnd =>
- Make_Integer_Literal (Loc, Scope_Depth (Act_Constr))),
+ if not CodePeer_Mode then
+ Insert_Action (N,
+ Make_Implicit_If_Statement (N,
+ Condition =>
+ Make_Op_Gt (Loc,
+ Left_Opnd =>
+ Build_Get_Access_Level (Loc, New_Copy_Tree (Tag_Arg)),
+ Right_Opnd =>
+ Make_Integer_Literal (Loc, Scope_Depth (Act_Constr))),
- Then_Statements => New_List (
- Make_Raise_Statement (Loc,
- New_Occurrence_Of (RTE (RE_Tag_Error), Loc)))));
+ Then_Statements => New_List (
+ Make_Raise_Statement (Loc,
+ New_Occurrence_Of (RTE (RE_Tag_Error), Loc)))));
+ end if;
if Is_Interface (Etype (Act_Constr)) then
@@ -505,10 +507,11 @@
-- Do not generate a run-time check on the built object if tag
-- checks are suppressed for the result type or tagged type expansion
- -- is disabled.
+ -- is disabled or if CodePeer_Mode.
if Tag_Checks_Suppressed (Etype (Result_Typ))
or else not Tagged_Type_Expansion
+ or else CodePeer_Mode
then
null;