summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 15:51:41 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 15:51:41 +0000
commit3f42e2a77bb6c09ed2e47542cc32369e93f315a4 (patch)
treeafdcca1f06b9d1a28fb282a8ac450f7220d6d1aa /gcc/ada/par-ch5.adb
parent05f3e139921b55a4ce3ec9a168ee87b5713e12e9 (diff)
downloadgcc-3f42e2a77bb6c09ed2e47542cc32369e93f315a4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177052 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch5.adb')
-rw-r--r--gcc/ada/par-ch5.adb12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index 1949595720b..acea49b7445 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;