gcc/ada/
* sem_res.adb (Is_Assignment_Or_Object_Expression): Whitespace
cleanup.
(Is_Attribute_Expression): Prevent AST climbing from going to
the root of the compilation unit.
Expr : Node_Id) return Boolean
is
begin
- if Nkind (Context) in
- N_Assignment_Statement | N_Object_Declaration
+ if Nkind (Context) in N_Assignment_Statement | N_Object_Declaration
and then Expression (Context) = Expr
then
return True;
while Present (N) loop
if Nkind (N) = N_Attribute_Reference then
return True;
+
+ -- Prevent the search from going too far
+
+ elsif Is_Body_Or_Package_Declaration (N) then
+ return False;
end if;
N := Parent (N);