2008-08-01 Ed Schonberg <schonberg@adacore.com>
authorEd Schonberg <schonberg@adacore.com>
Fri, 1 Aug 2008 09:03:23 +0000 (11:03 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2008 09:03:23 +0000 (11:03 +0200)
* sem_prag.adb:
(Check_Precondition_Postcondition): If not generating code, analyze the
expression in a postcondition that appears in a subprogram body, so that
it is properly decorated for ASIS use.

From-SVN: r138489

gcc/ada/sem_prag.adb

index b54cda616cf67b06f63bf4de7525e717499b038d..99f9f8f9f52da4f71d8946f36279420bfa9f3a10 100644 (file)
@@ -1451,6 +1451,15 @@ package body Sem_Prag is
          if Nkind (Parent (N)) = N_Subprogram_Body
            and then List_Containing (N) = Declarations (Parent (N))
          then
+            if Operating_Mode /= Generate_Code then
+
+               --  Analyze expression in pragma, for correctness
+               --  and for ASIS use.
+
+               Preanalyze_Spec_Expression
+                 (Get_Pragma_Arg (Arg1), Standard_Boolean);
+            end if;
+
             In_Body := True;
             return;