2008-04-08 Ed Schonberg <schonberg@adacore.com>
authorEd Schonberg <schonberg@adacore.com>
Tue, 8 Apr 2008 06:54:13 +0000 (08:54 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 8 Apr 2008 06:54:13 +0000 (08:54 +0200)
* par-ch3.adb (P_Type_Declaration) Reject the keyword "synchronized"
in a type declaration, if this is not an interface declaration or
private type extension.

From-SVN: r134045

gcc/ada/par-ch3.adb

index 3a6fc11103266121b4019d5c0cbb8473624ab34d..8eb0e71975c3d7d29801043a302149fbfe6c7994 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2008, 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- --
@@ -767,6 +767,10 @@ package body Ch3 is
                   --  Interface
 
                   else
+                     if Token /= Tok_Interface then
+                        Error_Msg_SC ("NEW or INTERFACE expected");
+                     end if;
+
                      Typedef_Node :=
                        P_Interface_Type_Definition (Abstract_Present);
                      Abstract_Present := True;