mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 12:41:03 +08:00
[multiple changes]
2010-09-09 Robert Dewar <dewar@adacore.com> * par-ch4.adb (Box_Error): New procedure. 2010-09-09 Thomas Quinot <quinot@adacore.com> * sem.adb: Minor reformatting. 2010-09-09 Pascal Obry <obry@adacore.com> * prj-env.adb: Style fix, use /and then/ and /or else/. * gnat_ugn.texi: Fix typos. From-SVN: r164053
This commit is contained in:
parent
1a14a58c73
commit
edb740aa72
@ -1,3 +1,16 @@
|
||||
2010-09-09 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* par-ch4.adb (Box_Error): New procedure.
|
||||
|
||||
2010-09-09 Thomas Quinot <quinot@adacore.com>
|
||||
|
||||
* sem.adb: Minor reformatting.
|
||||
|
||||
2010-09-09 Pascal Obry <obry@adacore.com>
|
||||
|
||||
* prj-env.adb: Style fix, use /and then/ and /or else/.
|
||||
* gnat_ugn.texi: Fix typos.
|
||||
|
||||
2010-09-03 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
PR ada/45499
|
||||
|
@ -27456,7 +27456,7 @@ end API;
|
||||
|
||||
@noindent
|
||||
Note that a variable is
|
||||
@strong{always imported with a Stdcall convention}. A function
|
||||
@strong{always imported with a DLL convention}. A function
|
||||
can have @code{C} or @code{Stdcall} convention.
|
||||
(@pxref{Windows Calling Conventions}).
|
||||
|
||||
@ -28474,7 +28474,6 @@ The program is built with foreign tools and the DLL is built with
|
||||
@item
|
||||
The program is built with @code{GCC/GNAT} and the DLL is built with
|
||||
foreign tools.
|
||||
@item
|
||||
@end enumerate
|
||||
|
||||
@noindent
|
||||
|
@ -1153,6 +1153,33 @@ package body Ch4 is
|
||||
Lparen_Sloc : Source_Ptr;
|
||||
Scan_State : Saved_Scan_State;
|
||||
|
||||
procedure Box_Error;
|
||||
-- Called if <> is encountered as positional aggregate element. Issues
|
||||
-- error message and sets Expr_Node to Error.
|
||||
|
||||
---------------
|
||||
-- Box_Error --
|
||||
---------------
|
||||
|
||||
procedure Box_Error is
|
||||
begin
|
||||
if Ada_Version < Ada_2005 then
|
||||
Error_Msg_SC ("box in aggregate is an Ada 2005 extension");
|
||||
end if;
|
||||
|
||||
-- Ada 2005 (AI-287): The box notation is allowed only with named
|
||||
-- notation because positional notation might be error prone. For
|
||||
-- example, in "(X, <>, Y, <>)", there is no type associated with
|
||||
-- the boxes, so you might not be leaving out the components you
|
||||
-- thought you were leaving out.
|
||||
|
||||
Error_Msg_SC ("(Ada 2005) box only allowed with named notation");
|
||||
Scan; -- past box
|
||||
Expr_Node := Error;
|
||||
end Box_Error;
|
||||
|
||||
-- Start of processsing for P_Aggregate_Or_Paren_Expr
|
||||
|
||||
begin
|
||||
Lparen_Sloc := Token_Ptr;
|
||||
T_Left_Paren;
|
||||
@ -1196,26 +1223,17 @@ package body Ch4 is
|
||||
end if;
|
||||
end if;
|
||||
|
||||
-- Ada 2005 (AI-287): The box notation is allowed only with named
|
||||
-- notation because positional notation might be error prone. For
|
||||
-- example, in "(X, <>, Y, <>)", there is no type associated with
|
||||
-- the boxes, so you might not be leaving out the components you
|
||||
-- thought you were leaving out.
|
||||
-- Scan expression, handling box appearing as positional argument
|
||||
|
||||
if Ada_Version >= Ada_05 and then Token = Tok_Box then
|
||||
Error_Msg_SC ("(Ada 2005) box notation only allowed with "
|
||||
& "named notation");
|
||||
Scan; -- past BOX
|
||||
Aggregate_Node := New_Node (N_Aggregate, Lparen_Sloc);
|
||||
return Aggregate_Node;
|
||||
if Token = Tok_Box then
|
||||
Box_Error;
|
||||
else
|
||||
Expr_Node := P_Expression_Or_Range_Attribute_If_OK;
|
||||
end if;
|
||||
|
||||
Expr_Node := P_Expression_Or_Range_Attribute_If_OK;
|
||||
|
||||
-- Extension aggregate case
|
||||
|
||||
if Token = Tok_With then
|
||||
|
||||
if Nkind (Expr_Node) = N_Attribute_Reference
|
||||
and then Attribute_Name (Expr_Node) = Name_Range
|
||||
then
|
||||
@ -1316,8 +1334,7 @@ package body Ch4 is
|
||||
"extension aggregate");
|
||||
raise Error_Resync;
|
||||
|
||||
-- A range attribute can only appear as part of a discrete choice
|
||||
-- list.
|
||||
-- Range attribute can only appear as part of a discrete choice list
|
||||
|
||||
elsif Nkind (Expr_Node) = N_Attribute_Reference
|
||||
and then Attribute_Name (Expr_Node) = Name_Range
|
||||
@ -1386,11 +1403,17 @@ package body Ch4 is
|
||||
exit;
|
||||
end if;
|
||||
|
||||
-- Deal with misused box
|
||||
|
||||
if Token = Tok_Box then
|
||||
Box_Error;
|
||||
|
||||
-- Otherwise initiate for reentry to top of loop by scanning an
|
||||
-- initial expression, unless the first token is OTHERS.
|
||||
|
||||
if Token = Tok_Others then
|
||||
elsif Token = Tok_Others then
|
||||
Expr_Node := Empty;
|
||||
|
||||
else
|
||||
Save_Scan_State (Scan_State); -- at start of expression
|
||||
Expr_Node := P_Expression_Or_Range_Attribute_If_OK;
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- --
|
||||
-- B o d y --
|
||||
-- --
|
||||
-- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
|
||||
-- Copyright (C) 2001-2010, 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- --
|
||||
@ -1582,7 +1582,7 @@ package body Prj.Env is
|
||||
-- For the object path, we make a distinction depending on
|
||||
-- Including_Libraries.
|
||||
|
||||
if Objects_Path and Including_Libraries then
|
||||
if Objects_Path and then Including_Libraries then
|
||||
if Project.Objects_Path_File_With_Libs = No_Path then
|
||||
Object_Path_Table.Init (Object_Paths);
|
||||
Process_Object_Dirs := True;
|
||||
@ -1602,7 +1602,7 @@ package body Prj.Env is
|
||||
-- If there is something to do, set Seen to False for all projects,
|
||||
-- then call the recursive procedure Add for Project.
|
||||
|
||||
if Process_Source_Dirs or Process_Object_Dirs then
|
||||
if Process_Source_Dirs or else Process_Object_Dirs then
|
||||
For_All_Projects (Project, Dummy);
|
||||
end if;
|
||||
|
||||
|
@ -67,7 +67,7 @@ package body Sem is
|
||||
-- Controls debugging printouts for Walk_Library_Items
|
||||
|
||||
Outer_Generic_Scope : Entity_Id := Empty;
|
||||
-- Global reference to the outer scope that is generic. In a non- generic
|
||||
-- Global reference to the outer scope that is generic. In a non-generic
|
||||
-- context, it is empty. At the moment, it is only used for avoiding
|
||||
-- freezing of external references in generics.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user