+2008-04-14 Robert Dewar <dewar@adacore.com>
+
+ * sem_util.ads, sem_util.adb (In_Subprogram): Remove.
+ * sem_attr.adb (Anayze_Attribute): Check for Current_Subprogram
+ directly.
+
2008-04-14 Samuel Tardieu <sam@rfc1149.net>
PR ada/18680
Check_E0;
Set_Etype (N, P_Type);
- if not In_Subprogram then
+ if No (Current_Subprogram) then
Error_Attr ("attribute % can only appear within subprogram", N);
end if;
return False;
end In_Package_Body;
- -------------------
- -- In_Subprogram --
- -------------------
-
- function In_Subprogram return Boolean is
- begin
- return Current_Subprogram /= Empty;
- end In_Subprogram;
-
--------------------------------------
-- In_Subprogram_Or_Concurrent_Unit --
--------------------------------------
function In_Package_Body return Boolean;
-- Returns True if current scope is within a package body
- function In_Subprogram return Boolean;
- -- Determines if the current scope is within a subprogram compilation
- -- unit (inside a subprogram declaration, subprogram body, or generic
- -- subprogram declaration). The test is for appearing anywhere within
- -- such a construct (that is it does not need to be directly within).
-
function In_Subprogram_Or_Concurrent_Unit return Boolean;
-- Determines if the current scope is within a subprogram compilation
-- unit (inside a subprogram declaration, subprogram body, or generic