OSDN Git Service

2007-12-06 Geert Bosch <bosch@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2007 10:32:23 +0000 (10:32 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2007 10:32:23 +0000 (10:32 +0000)
* sem_eval.adb (Eval_Real_Literal): N_Constant_Declaration is a static
context, so do not call Check_Non_Static_Context.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130857 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/sem_eval.adb

index d3b2954..d7acaa7 100644 (file)
@@ -2241,14 +2241,16 @@ package body Sem_Eval is
    --  in the expander that do not correspond to static expressions.
 
    procedure Eval_Real_Literal (N : Node_Id) is
+      PK : constant Node_Kind := Nkind (Parent (N));
+
    begin
-      --  If the literal appears in a non-expression context, then it is
-      --  certainly appearing in a non-static context, so check it.
+      --  If the literal appears in a non-expression context
+      --  and not as part of a number declaration, then it is
+      --  appearing in a non-static context, so check it.
 
-      if Nkind (Parent (N)) not in N_Subexpr then
+      if PK not in N_Subexpr and then PK /= N_Number_Declaration then
          Check_Non_Static_Context (N);
       end if;
-
    end Eval_Real_Literal;
 
    ------------------------