[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 9 Sep 2010 08:51:08 +0000 (10:51 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 9 Sep 2010 08:51:08 +0000 (10:51 +0200)
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

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/par-ch4.adb
gcc/ada/prj-env.adb
gcc/ada/sem.adb

index 020746bf613dce9917c9b4c6fc883793142dd436..ae8b006d6ae188e3b026fcfd5a8249a6f2db72e0 100644 (file)
@@ -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
index e18baef53d5090c68670f5b9674a2e72a5b9850b..480f391a4ef41e6604c3238cc5c02d7ebbd3100f 100644 (file)
@@ -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
index 2b4e6215562f36c7fb4576c1579427f9150dc57e..6de5e84aed93f6ba6c429bc8648d118c9ca8d808 100644 (file)
@@ -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;
index 39bda01987efbe034edf79567a380d9ad9ca3a9b..7af52e8451aff4f780079d8388218148745511fc 100644 (file)
@@ -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;
 
index f18e5e687850ec92a5d3f9fb53b5a6b54462a1e5..f5c7629b401e62a7509d76e4c761f252d8557aef 100644 (file)
@@ -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.