diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-02-06 10:58:37 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-02-06 10:58:37 +0100 |
commit | cbee4f7497366895219ee4caa04b9d2f4c45ce83 (patch) | |
tree | 7a23f0eca034c65b3cd8a21c3e824a881db3440c /gcc/ada/sem_util.adb | |
parent | e2ef0ff683ddbb3dceb0888e2ba294ddda55da53 (diff) | |
download | gcc-cbee4f7497366895219ee4caa04b9d2f4c45ce83.zip gcc-cbee4f7497366895219ee4caa04b9d2f4c45ce83.tar.gz gcc-cbee4f7497366895219ee4caa04b9d2f4c45ce83.tar.bz2 |
[multiple changes]
2014-02-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Subprogram_Contract, Append_Enabled_Item):
Take into account the Split_PPC flag to ensure that conjuncts
in a composite postcondition aspect are tested in source order.
2014-02-06 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Analyze_Generic_Subprogram_Body): Flag illegal
use of SPARK_Mode.
* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Flag
illegal use of SPARK_Mode.
(Instantiate_Subprogram_Body): Flag illegal use of SPARK_Mode.
* sem_prag.adb (Analyze_Pragma): Code reformatting.
* sem_util.adb Add with and use clause for Aspects.
(Check_SPARK_Mode_In_Generic): New routine.
* sem_util.ads (Check_SPARK_Mode_In_Generic): New routine.
2014-02-06 Thomas Quinot <quinot@adacore.com>
* a-calend.adb (Formatting_Operations.Split): Ensure that
Time_Error is raised for invalid time values.
From-SVN: r207536
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index ba978e1..a2501ca 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -23,6 +23,7 @@ -- -- ------------------------------------------------------------------------------ +with Aspects; use Aspects; with Atree; use Atree; with Casing; use Casing; with Checks; use Checks; @@ -2699,6 +2700,31 @@ package body Sem_Util is end if; end Check_Result_And_Post_State; + --------------------------------- + -- Check_SPARK_Mode_In_Generic -- + --------------------------------- + + procedure Check_SPARK_Mode_In_Generic (N : Node_Id) is + Aspect : Node_Id; + + begin + -- Try to find aspect SPARK_Mode and flag it as illegal + + if Has_Aspects (N) then + Aspect := First (Aspect_Specifications (N)); + while Present (Aspect) loop + if Get_Aspect_Id (Aspect) = Aspect_SPARK_Mode then + Error_Msg_Name_1 := Name_SPARK_Mode; + Error_Msg_N + ("incorrect placement of aspect % on a generic", Aspect); + exit; + end if; + + Next (Aspect); + end loop; + end if; + end Check_SPARK_Mode_In_Generic; + ------------------------------ -- Check_Unprotected_Access -- ------------------------------ |