]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
freeze.adb (Freeze_Entity): Remove the check concerning volatile types in SPARK as...
authorHristian Kirtchev <kirtchev@adacore.com>
Fri, 13 Jun 2014 09:51:30 +0000 (09:51 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jun 2014 09:51:30 +0000 (11:51 +0200)
2014-06-13  Hristian Kirtchev  <kirtchev@adacore.com>

* freeze.adb (Freeze_Entity): Remove the check concerning volatile
types in SPARK as it is poorly placed and poorly formulated. The
check was flagging ALL volatile entities as illegal in SPARK.
* sem_prag.adb (Process_Atomic_Shared_Volatile): Flag volatile
types as illegal in SPARK.

From-SVN: r211615

gcc/ada/ChangeLog
gcc/ada/freeze.adb
gcc/ada/sem_prag.adb

index fb9e804b5f434c584de46786f1e38cd31e3027ba..98c3856d85af460366739efa94991d0bcf01620b 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-13  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * freeze.adb (Freeze_Entity): Remove the check concerning volatile
+       types in SPARK as it is poorly placed and poorly formulated. The
+       check was flagging ALL volatile entities as illegal in SPARK.
+       * sem_prag.adb (Process_Atomic_Shared_Volatile): Flag volatile
+       types as illegal in SPARK.
+
 2014-06-13  Robert Dewar  <dewar@adacore.com>
 
        * sem_cat.adb: Minor reformatting.
index e1bfc9a3bbed0dead58a7d3d6a159eca546ebbc8..ec944a102be56b12736bf0c5d8e095a383b6bc3e 100644 (file)
@@ -3686,14 +3686,6 @@ package body Freeze is
          Analyze_Aspects_At_Freeze_Point (E);
       end if;
 
-      --  The following check is only relevant when SPARK_Mode is on as this
-      --  is not a standard Ada legality rule. Volatile types are not allowed
-      --  (SPARK RM C.6(1)).
-
-      if SPARK_Mode = On and then Is_SPARK_Volatile (E) then
-         Error_Msg_N ("volatile type not allowed", E);
-      end if;
-
       --  Here to freeze the entity
 
       Set_Is_Frozen (E);
index c4f10ee6635f4f2a0cba759b2c498ee2cb7a35f9..284cdb5c75b35e07c34072c0712e6628f9f287c7 100644 (file)
@@ -6370,6 +6370,14 @@ package body Sem_Prag is
             Set_Treat_As_Volatile (E);
             Set_Treat_As_Volatile (Underlying_Type (E));
 
+            --  The following check is only relevant when SPARK_Mode is on as
+            --  this is not a standard Ada legality rule. Volatile types are
+            --  not allowed (SPARK RM C.6(1)).
+
+            if SPARK_Mode = On and then Prag_Id = Pragma_Volatile then
+               Error_Msg_N ("volatile type not allowed", E);
+            end if;
+
          elsif K = N_Object_Declaration
            or else (K = N_Component_Declaration
                      and then Original_Record_Component (E) = E)