@@ -4222,13 +4222,21 @@
-- Duplicate the call. This is required to avoid problems with
-- the tree transformations performed by Try_Object_Operation.
+ -- Set properly the parent of the copied call, because it is
+ -- about to be reanalyzed.
- and then
- (N => Sinfo.Name (New_Copy_Tree (Parent (N))),
- CW_Test_Only => True)
+ Par : constant Node_Id := New_Copy_Tree (Parent (N));
+ Set_Parent (Par, Parent (Parent (N)));
+ if Try_Object_Operation
+ (Sinfo.Name (Par), CW_Test_Only => True)
+ end if;