Commit c74afd84 by Arnaud Charlet

[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
parent 50ea6357
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> 2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, sem_attr.adb, * sem_prag.adb, sem_attr.adb,
......
...@@ -855,7 +855,7 @@ __gnat_rmdir (char *path) ...@@ -855,7 +855,7 @@ __gnat_rmdir (char *path)
int int
__gnat_fputwc(int c, FILE *stream) __gnat_fputwc(int c, FILE *stream)
{ {
#if ! defined (__vxworks) && ! defined (IS_CROSS) #if ! defined (__vxworks)
return fputwc ((wchar_t)c, stream); return fputwc ((wchar_t)c, stream);
#else #else
return fputc (c, stream); return fputc (c, stream);
......
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
-- and fully analyzed (possibly with expansion) during the semantic -- and fully analyzed (possibly with expansion) during the semantic
-- analysis of subprogram bodies. -- analysis of subprogram bodies.
with Namet; use Namet; with Namet; use Namet;
with Snames; use Snames; with Snames; use Snames;
with Types; use Types; with Types; use Types;
package Aspects is package Aspects is
...@@ -205,10 +205,14 @@ package Aspects is ...@@ -205,10 +205,14 @@ package Aspects is
-- The following array indicates aspects that accept 'Class -- The following array indicates aspects that accept 'Class
Class_Aspect_OK : constant array (Aspect_Id) of Boolean := 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_Pre => True,
Aspect_Predicate => True, Aspect_Predicate => True,
Aspect_Post => True, Aspect_Post => True,
Aspect_Read => True,
Aspect_Write => True,
Aspect_Type_Invariant => True, Aspect_Type_Invariant => True,
others => False); others => False);
......
...@@ -502,6 +502,7 @@ The Implementation of Standard I/O ...@@ -502,6 +502,7 @@ The Implementation of Standard I/O
* Text Translation:: * Text Translation::
* Shared Files:: * Shared Files::
* Filenames encoding:: * Filenames encoding::
* File content encoding::
* Open Modes:: * Open Modes::
* Operations on C Streams:: * Operations on C Streams::
* Interfacing to C Streams:: * Interfacing to C Streams::
...@@ -17288,6 +17289,7 @@ these additional facilities are also described in this chapter. ...@@ -17288,6 +17289,7 @@ these additional facilities are also described in this chapter.
* Text Translation:: * Text Translation::
* Shared Files:: * Shared Files::
* Filenames encoding:: * Filenames encoding::
* File content encoding::
* Open Modes:: * Open Modes::
* Operations on C Streams:: * Operations on C Streams::
* Interfacing to C Streams:: * Interfacing to C Streams::
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -763,7 +763,7 @@ package body System.File_IO is ...@@ -763,7 +763,7 @@ package body System.File_IO is
while Index < Form'Last loop while Index < Form'Last loop
Index := Index + 1; Index := Index + 1;
-- Loop through the RMS Keys and dispatch. -- Loop through the RMS Keys and dispatch
for Key in RMS_Keys loop for Key in RMS_Keys loop
declare declare
......
...@@ -1683,6 +1683,22 @@ package body Sem_Ch13 is ...@@ -1683,6 +1683,22 @@ package body Sem_Ch13 is
Set_Never_Set_In_Source (E, False); Set_Never_Set_In_Source (E, False);
end if; 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 -- Construct the attribute definition clause
Aitem := Aitem :=
...@@ -8095,7 +8111,8 @@ package body Sem_Ch13 is ...@@ -8095,7 +8111,8 @@ package body Sem_Ch13 is
procedure Check_Overloaded_Name is procedure Check_Overloaded_Name is
begin begin
if not Is_Overloaded (End_Decl_Expr) then 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 else
Err := True; Err := True;
......
...@@ -3477,8 +3477,8 @@ package body Sem_Util is ...@@ -3477,8 +3477,8 @@ package body Sem_Util is
-- In Ada 2012, If the type has an incomplete partial view, there -- In Ada 2012, If the type has an incomplete partial view, there
-- may be primitive operations declared before the full view, so -- may be primitive operations declared before the full view, so
-- we need to start scanning from the the incomplete view, which -- we need to start scanning from the incomplete view, which is
-- is earlier on the entity chain. -- earlier on the entity chain.
elsif Nkind (Parent (B_Type)) = N_Full_Type_Declaration elsif Nkind (Parent (B_Type)) = N_Full_Type_Declaration
and then Present (Incomplete_View (Parent (B_Type))) and then Present (Incomplete_View (Parent (B_Type)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment