aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-awk.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:54:24 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:54:24 +0200
commit1cdfa9be54975f0566d6f261a706dcb8d767601d (patch)
tree3dfed43821a83ea125d3b2afd4c3d6fa17d004b1 /gcc/ada/g-awk.adb
parent243cae0a5108e18638c9c4844baaf392171130d4 (diff)
downloadgcc-1cdfa9be54975f0566d6f261a706dcb8d767601d.zip
gcc-1cdfa9be54975f0566d6f261a706dcb8d767601d.tar.gz
gcc-1cdfa9be54975f0566d6f261a706dcb8d767601d.tar.bz2
[multiple changes]
2011-08-03 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Create_Finalizer): Treat freeze nodes in similar fashion to packages. This ensures that the finalizer body will not end up inside the freeze node. (Process_Declarations): Add code to detect whether a freeze node has a nested finalization collection. 2011-08-03 Pascal Obry <obry@adacore.com> * g-awk.adb, g-awk.ads: Make GNAT.AWK API compatible with Ada 2005. (Current_Session): Return a not null access to Session_Type. (Default_Session): Likewise. From-SVN: r177282
Diffstat (limited to 'gcc/ada/g-awk.adb')
-rw-r--r--gcc/ada/g-awk.adb27
1 files changed, 5 insertions, 22 deletions
diff --git a/gcc/ada/g-awk.adb b/gcc/ada/g-awk.adb
index 36bcca9..f2c934c 100644
--- a/gcc/ada/g-awk.adb
+++ b/gcc/ada/g-awk.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2010, AdaCore --
+-- Copyright (C) 2000-2011, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,11 +29,6 @@
-- --
------------------------------------------------------------------------------
-pragma Ada_95;
--- This is needed because the pragmas Warnings (Off) in Current_Session and
--- Default_Session (see below) do not work when compiling clients of this
--- package that instantiate generic units herein.
-
with Ada.Exceptions;
with Ada.Text_IO;
with Ada.Strings.Unbounded;
@@ -735,30 +730,18 @@ package body GNAT.AWK is
-- Current_Session --
---------------------
- function Current_Session return Session_Type is
+ function Current_Session return not null access Session_Type is
begin
- pragma Warnings (Off);
- return Cur_Session;
- -- ???The above return statement violates the Ada 2005 rule forbidding
- -- copying of limited objects (see RM-7.5(2.8/2)). When compiled with
- -- -gnatg, the compiler gives a warning instead of an error, so we can
- -- turn it off.
- pragma Warnings (On);
+ return Cur_Session.Self;
end Current_Session;
---------------------
-- Default_Session --
---------------------
- function Default_Session return Session_Type is
+ function Default_Session return not null access Session_Type is
begin
- pragma Warnings (Off);
- return Def_Session;
- -- ???The above return statement violates the Ada 2005 rule forbidding
- -- copying of limited objects (see RM-7.5(2.8/2)). When compiled with
- -- -gnatg, the compiler gives a warning instead of an error, so we can
- -- turn it off.
- pragma Warnings (On);
+ return Def_Session.Self;
end Default_Session;
--------------------