diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-01 17:51:41 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-01 17:51:41 +0200 |
commit | 8ed68165ed9a61e0e0a0d3de377d37718ee24b61 (patch) | |
tree | afdcca1f06b9d1a28fb282a8ac450f7220d6d1aa /gcc/ada/par-ch5.adb | |
parent | 4230bdb759b717d87186ccb1df225f241322386b (diff) | |
download | gcc-8ed68165ed9a61e0e0a0d3de377d37718ee24b61.zip gcc-8ed68165ed9a61e0e0a0d3de377d37718ee24b61.tar.gz gcc-8ed68165ed9a61e0e0a0d3de377d37718ee24b61.tar.bz2 |
[multiple changes]
2011-08-01 Yannick Moy <moy@adacore.com>
* sem_util.ads, sem_util.adb, par.adb, par_util.adb
(Formal_Error_Msg, Formal_Error_Msg_N, Formal_Error_Msg_SP): move
procedures out of these packages.
* errout.ads, errout.adb
(Formal_Error_Msg, Formal_Error_Msg_N, Formal_Error_Msg_SP): move
procedures in of this package
(Formal_Error_Msg_NE): new procedure for wrapper on Error_Msg_NE
* par-ch5.adb (Parse_Decls_Begin_End): issue syntax error in SPARK mode
on misplaced later vs initial declarations, like in Ada 83
* sem_attr.adb (Processing for Analyze_Attribute): issue error in
formal mode on attribute of private type whose full type declaration
is not visible
* sem_ch3.adb (Analyze_Declarations): issue error in formal mode on a
package declaration inside a package specification
(Analyze_Full_Type_Declaration): issue error in formal mode on
controlled type or discriminant type
* sem_ch6.adb (Analyze_Subprogram_Specification): only issue error on
user-defined operator means that it should come from the source
(New_Overloaded_Entity): issue error in formal mode on overloaded
entity.
* sem_ch6.ads, sem_ch13.ads: typos in comments.
2011-08-01 Thomas Quinot <quinot@adacore.com>
* atree.adb: Minor reformatting.
* checks.adb: Minor reformatting.
From-SVN: r177052
Diffstat (limited to 'gcc/ada/par-ch5.adb')
-rw-r--r-- | gcc/ada/par-ch5.adb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index 1949595..acea49b 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -2110,9 +2110,12 @@ package body Ch5 is begin Decls := P_Declarative_Part; - -- Check for misplacement of later vs basic declarations in Ada 83 + -- Check for misplacement of later vs basic declarations in Ada 83. + -- The same is true for the SPARK mode: although SPARK 95 removes + -- the distinction between initial and later declarative items, + -- the distinction remains in the Examiner. (JB01-005) - if Ada_Version = Ada_83 then + if Ada_Version = Ada_83 or else SPARK_Mode then Decl := First (Decls); -- Loop through sequence of basic declarative items @@ -2139,6 +2142,11 @@ package body Ch5 is Error_Msg_Sloc := Body_Sloc; Error_Msg_N ("(Ada 83) decl cannot appear after body#", Decl); + else + pragma Assert (SPARK_Mode); + Error_Msg_Sloc := Body_Sloc; + Formal_Error_Msg_N + ("decl cannot appear after body#", Decl); end if; end if; |