When determining whether a call to protected function appears within
a pragma expression we can safely stop at the subprogram body.
Cleanup related to recently added support for a new SPARK aspects,
whose implementation was based on Contract_Cases.
gcc/ada/
* sem_util.adb (Check_Internal_Protected_Use): Add standard protection
against search going too far.
("internal call cannot appear in default for formal of "
& "protected operation", N);
return;
+
+ -- Prevent the search from going too far
+
+ elsif Is_Body_Or_Package_Declaration (P) then
+ exit;
end if;
P := Parent (P);