diff options
author | Raphaël AMIARD <amiard@adacore.com> | 2024-08-29 12:43:54 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-10-08 10:37:13 +0200 |
commit | cee753879cdb61c27dd584fcc4932969fb2cd0be (patch) | |
tree | c91aeb77022ff05a36aea05eb421b5f8d92c0027 /gcc/ada/gnat_ugn.texi | |
parent | a6fc30b29f2e89057538500bb7cf2e233d4e5e41 (diff) | |
download | gcc-cee753879cdb61c27dd584fcc4932969fb2cd0be.zip gcc-cee753879cdb61c27dd584fcc4932969fb2cd0be.tar.gz gcc-cee753879cdb61c27dd584fcc4932969fb2cd0be.tar.bz2 |
ada: Use semantics from the RFC for declarative items mixed with statements
We want to allow statements lists with declarations *and* an exception
handler. What follows from this is that declarations declared in the
statement list are *not* visible from the exception handler, and that
the following code:
declare
A : Integer := 12;
begin
A : Integer := 15;
<stmts>
exception
when others => ...
Roughly expands to:
declare
A : Integer := 12;
begin
declare
A : Integer := 15;
begin
<stmts>
exception
when others => ...
As such, in the code above, there is no more error triggered for
conflicting declarations of `A`.
Move "Local declarations without block" into curated extensions
Restrict legal local decls in statement lists
Only accept object declarations & renamings, as well as use clauses for
gcc/ada/ChangeLog:
* par-ch11.adb (P_Sequence_Of_Statements): Remove Handled
parameter. Always wrap the statements in a block when there are
declarations in it.
* par-ch5.adb: Adapt call to P_Sequence_Of_Statements Update
outdated comment, remove useless `Style_Checks` pragma.
(P_Sequence_Of_Statements): Don't emit an error in core extensions
mode. Emit an error when a non valid declaration is parsed in
sequence of statements.
* par.adb: Adapt P_Sequence_Of_Statements' signature
* doc/gnat_rm/gnat_language_extensions.rst: Adapt documentation
now.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
Diffstat (limited to 'gcc/ada/gnat_ugn.texi')
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 9ba8984..7e27b1c 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -29695,8 +29695,8 @@ to permit their use in free software. @printindex ge -@anchor{d1}@w{ } @anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } +@anchor{d1}@w{ } @c %**end of body @bye |