aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 12:15:56 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 12:15:56 +0200
commitc74afd846db25c438a7f24254fe501a829109117 (patch)
tree76971b27d1da0b236c676cbee505dc9122a3a9e7
parent50ea63572d0e1705c44eee2a8a5d16882093d0bc (diff)
downloadgcc-c74afd846db25c438a7f24254fe501a829109117.zip
gcc-c74afd846db25c438a7f24254fe501a829109117.tar.gz
gcc-c74afd846db25c438a7f24254fe501a829109117.tar.bz2
[multiple changes]
2014-07-18 Gary Dismukes <dismukes@adacore.com> * sem_util.adb: Minor typo correction. 2014-07-18 Ben Brosgol <brosgol@adacore.com> * gnat_rm.texi: Complete previous change. 2014-07-18 Pascal Obry <obry@adacore.com> * s-fileio.adb: Minor style fix. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Detect improper specification of stream attributes for subtypes that are not first subtypes, to prevent malformed rep_item chains in the case of such illegal specifications for discriminated private subtypes. (Check_Overloaded_Name): Verify that the name is an entity name before other checks. 2014-07-18 Pascal Obry <obry@adacore.com> * adaint.c (__gnat_fputwc) Do not disable on cross-build. From-SVN: r212807
-rw-r--r--gcc/ada/ChangeLog25
-rw-r--r--gcc/ada/adaint.c2
-rw-r--r--gcc/ada/aspects.ads12
-rw-r--r--gcc/ada/gnat_rm.texi2
-rw-r--r--gcc/ada/s-fileio.adb4
-rw-r--r--gcc/ada/sem_ch13.adb19
-rw-r--r--gcc/ada/sem_util.adb4
7 files changed, 58 insertions, 10 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 8bbebc0..09ccb01 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,28 @@
+2014-07-18 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_util.adb: Minor typo correction.
+
+2014-07-18 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_rm.texi: Complete previous change.
+
+2014-07-18 Pascal Obry <obry@adacore.com>
+
+ * s-fileio.adb: Minor style fix.
+
+2014-07-18 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Detect improper
+ specification of stream attributes for subtypes that are not
+ first subtypes, to prevent malformed rep_item chains in the case
+ of such illegal specifications for discriminated private subtypes.
+ (Check_Overloaded_Name): Verify that the name is an entity name
+ before other checks.
+
+2014-07-18 Pascal Obry <obry@adacore.com>
+
+ * adaint.c (__gnat_fputwc) Do not disable on cross-build.
+
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, sem_attr.adb,
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 184d645..2f3a730 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -855,7 +855,7 @@ __gnat_rmdir (char *path)
int
__gnat_fputwc(int c, FILE *stream)
{
-#if ! defined (__vxworks) && ! defined (IS_CROSS)
+#if ! defined (__vxworks)
return fputwc ((wchar_t)c, stream);
#else
return fputc (c, stream);
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index 7756117..bcc2234 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -64,9 +64,9 @@
-- and fully analyzed (possibly with expansion) during the semantic
-- analysis of subprogram bodies.
-with Namet; use Namet;
-with Snames; use Snames;
-with Types; use Types;
+with Namet; use Namet;
+with Snames; use Snames;
+with Types; use Types;
package Aspects is
@@ -205,10 +205,14 @@ package Aspects is
-- The following array indicates aspects that accept 'Class
Class_Aspect_OK : constant array (Aspect_Id) of Boolean :=
- (Aspect_Invariant => True,
+ (Aspect_Input => True,
+ Aspect_Invariant => True,
+ Aspect_Output => True,
Aspect_Pre => True,
Aspect_Predicate => True,
Aspect_Post => True,
+ Aspect_Read => True,
+ Aspect_Write => True,
Aspect_Type_Invariant => True,
others => False);
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 8c39be0..8ff1c64 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -502,6 +502,7 @@ The Implementation of Standard I/O
* Text Translation::
* Shared Files::
* Filenames encoding::
+* File content encoding::
* Open Modes::
* Operations on C Streams::
* Interfacing to C Streams::
@@ -17288,6 +17289,7 @@ these additional facilities are also described in this chapter.
* Text Translation::
* Shared Files::
* Filenames encoding::
+* File content encoding::
* Open Modes::
* Operations on C Streams::
* Interfacing to C Streams::
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index c166729..78dd34b 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -763,7 +763,7 @@ package body System.File_IO is
while Index < Form'Last loop
Index := Index + 1;
- -- Loop through the RMS Keys and dispatch.
+ -- Loop through the RMS Keys and dispatch
for Key in RMS_Keys loop
declare
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index d8cfad9..390fce7 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1683,6 +1683,22 @@ package body Sem_Ch13 is
Set_Never_Set_In_Source (E, False);
end if;
+ -- Correctness of the profile of a stream operation is
+ -- verified at the freeze point, but we must detect the
+ -- illegal specification of this aspect for a subtype now,
+ -- to prevent malformed rep_item chains.
+
+ if (A_Id = Aspect_Input
+ or else A_Id = Aspect_Output
+ or else A_Id = Aspect_Read
+ or else A_Id = Aspect_Write)
+ and not Is_First_Subtype (E)
+ then
+ Error_Msg_N
+ ("local name must be a first subtype", Aspect);
+ goto Continue;
+ end if;
+
-- Construct the attribute definition clause
Aitem :=
@@ -8095,7 +8111,8 @@ package body Sem_Ch13 is
procedure Check_Overloaded_Name is
begin
if not Is_Overloaded (End_Decl_Expr) then
- Err := Entity (End_Decl_Expr) /= Entity (Freeze_Expr);
+ Err := not Is_Entity_Name (End_Decl_Expr)
+ or else Entity (End_Decl_Expr) /= Entity (Freeze_Expr);
else
Err := True;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index ccebfe4..1716095 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -3477,8 +3477,8 @@ package body Sem_Util is
-- In Ada 2012, If the type has an incomplete partial view, there
-- may be primitive operations declared before the full view, so
- -- we need to start scanning from the the incomplete view, which
- -- is earlier on the entity chain.
+ -- we need to start scanning from the incomplete view, which is
+ -- earlier on the entity chain.
elsif Nkind (Parent (B_Type)) = N_Full_Type_Declaration
and then Present (Incomplete_View (Parent (B_Type)))