aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-05-21 14:45:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-05-21 14:45:44 +0200
commit601bb6b35ea9a185c360d73a90a3fcd5c9d286fd (patch)
tree01924246c65a2bf6ef0efdfdee15ae7d5b7057f3 /gcc/ada/sem_prag.adb
parentda574a866b86e92f0305e68ddb7f1993365fb5dd (diff)
downloadgcc-601bb6b35ea9a185c360d73a90a3fcd5c9d286fd.zip
gcc-601bb6b35ea9a185c360d73a90a3fcd5c9d286fd.tar.gz
gcc-601bb6b35ea9a185c360d73a90a3fcd5c9d286fd.tar.bz2
[multiple changes]
2014-05-21 Javier Miranda <miranda@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression.Apply_Accessibility_Check): Complete previous patch. 2014-05-21 Thomas Quinot <quinot@adacore.com> * g-socket.adb (Read and Write for Datagram_Socket_Stream_Type): Provide a behaviour more consistent with underlying datagram socket: do not attempt to loop over Send_Socket/Receive_Socket iterating along the buffer. 2014-05-21 Hristian Kirtchev <kirtchev@adacore.com> * freeze.adb (Freeze_Record_Type): Ensure that a discriminated or a tagged type is not labelled as volatile. Ensure that a non-volatile type has no volatile components. * sem_ch3.adb (Analyze_Object_Contract): Add local constant Obj_Typ. Code reformatting. Ensure that a discriminated or tagged object is not labelled as volatile. * sem_prag.adb (Process_Atomic_Shared_Volatile): Ensure that pragma Volatile applies to a full type declaration or an object declaration when SPARK mode is on. 2014-05-21 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For ASIS tools, reword the paragraph about providing options needed for compiling the argument source for the situation when a project file can be used as a tool parameter. 2014-05-21 Gary Dismukes <dismukes@adacore.com> * gnat_rm.texi: Minor typo fix. From-SVN: r210697
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index f5a5074..8365ff7 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -6387,6 +6387,21 @@ package body Sem_Prag is
Error_Pragma_Arg
("inappropriate entity for pragma%", Arg1);
end if;
+
+ -- The following check are only relevant when SPARK_Mode is on as
+ -- those are not a standard Ada legality rule. Pragma Volatile can
+ -- only apply to a full type declaration or an object declaration
+ -- (SPARK RM C.6(1)).
+
+ if SPARK_Mode = On
+ and then Prag_Id = Pragma_Volatile
+ and then not Nkind_In (K, N_Full_Type_Declaration,
+ N_Object_Declaration)
+ then
+ Error_Pragma_Arg
+ ("argument of pragma % must denote a full type or object "
+ & "declaration", Arg1);
+ end if;
end Process_Atomic_Shared_Volatile;
-------------------------------------------