diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-05-12 14:06:07 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-06-15 09:59:35 +0200 |
commit | 3ec78e11471c898328053884ac328cb898f91144 (patch) | |
tree | 89dd033a10146560e7a09f570ebc70f682c9f38d /gcc/ada/contracts.adb | |
parent | 8e5185ad60b1c801e41e76919a6bad8f3e4cdba4 (diff) | |
download | gcc-3ec78e11471c898328053884ac328cb898f91144.zip gcc-3ec78e11471c898328053884ac328cb898f91144.tar.gz gcc-3ec78e11471c898328053884ac328cb898f91144.tar.bz2 |
ada: Accept aspect Always_Terminates on packages
The recently added aspect Always_Terminates is now allowed on packages
and generic packages, but only when it has no arguments. The intuitive
meaning is that all subprograms declared in such a package are always
terminating.
gcc/ada/
* contracts.adb (Add_Contract_Item): Add pragma Always_Terminates to
package contract.
* sem_prag.adb (Analyze_Pragma): Accept pragma Always_Terminates on
packages and generic packages, but only when it has no arguments.
Diffstat (limited to 'gcc/ada/contracts.adb')
-rw-r--r-- | gcc/ada/contracts.adb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 0e87cee..26bc4b3 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -296,6 +296,9 @@ package body Contracts is elsif Prag_Nam = Name_Part_Of and then Is_Generic_Instance (Id) then Add_Classification; + elsif Prag_Nam = Name_Always_Terminates then + Add_Contract_Test_Case; + -- The pragma is not a proper contract item else |