Index: sem_ch13.adb =================================================================== --- sem_ch13.adb (revision 194777) +++ sem_ch13.adb (working copy) @@ -1606,6 +1606,17 @@ if Nkind (Parent (N)) = N_Compilation_Unit then Add_Global_Declaration (Aitem); + + -- If it is a subprogram body, add pragmas to list of + -- declarations in body. + + elsif Nkind (N) = N_Subprogram_Body then + if No (Declarations (N)) then + Set_Declarations (N, New_List); + end if; + + Append (Aitem, Declarations (N)); + else Insert_After (N, Aitem); end if;