aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-util.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-10-13 12:13:36 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-10-13 12:13:36 +0200
commite192a2cd62f2ed824f93edab18d9a5aabf764784 (patch)
tree731bb955325533b2b0c1662f3a2e9445eba13ef4 /gcc/ada/par-util.adb
parent54c42edf79e7319010b7efa0a1e78acabb0205bd (diff)
downloadgcc-e192a2cd62f2ed824f93edab18d9a5aabf764784.zip
gcc-e192a2cd62f2ed824f93edab18d9a5aabf764784.tar.gz
gcc-e192a2cd62f2ed824f93edab18d9a5aabf764784.tar.bz2
[multiple changes]
2011-10-13 Thomas Quinot <quinot@adacore.com> * par-ch2.adb, par.adb, par-util.adb, par-ch3.adb (Check_Future_Identifier): New subprogram, factors duplicated code from Par.Ch2.P_Identifier and Par.Ch3.P_Defining_Identifier. 2011-10-13 Thomas Quinot <quinot@adacore.com> * s-taprop-posix.adb (Initialize): Always raise Storage_Error if we fail to initialize CV attributes or CV. 2011-10-13 Thomas Quinot <quinot@adacore.com> * s-tasren.adb (Timed_Selective_Wait, case Accept_Alternative_Selected): Use Defer_Abort_Nestable, since we know abortion is already deferred. 2011-10-13 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch3.adb (Build_Class_Wide_Master): Moved to exp_ch9. (Build_Master_Renaming (function)): Removed. (Build_Master_Renaming (procedure)): Moved to exp_ch9. (Expand_Full_Type_Declaration): Alphabetize variables. Reformatting of code and comments. Rewrite the section on processing of anonymous access-to-task types in record components. * exp_ch3.ads (Build_Class_Wide_Master): Moved to exp_ch9. (Build_Master_Renaming): Moved to exp_ch9. * exp_ch9.adb (Build_Class_Wide_Master): Moved from exp_ch3. (Build_Master_Entity): Add formal parameter Use_Current. Reformatting of code and comments. (Build_Master_Renaming): Moved from exp_ch3. * exp_ch9.ads (Build_Class_Wide_Master): Moved from exp_ch3. Update comment on usage. (Build_Master_Entity): Add formal parameter Use_Current. Update comment on usage. (Build_Master_Renaming): Moved from exp_ch3. * sem_ch3.adb (Access_Definition): Remove redundant code to create a _master and a renaming. 2011-10-13 Ed Schonberg <schonberg@adacore.com> * lib-xref.adb: Do no emit reference to overridden operation, if it is internally generated. 2011-10-13 Vincent Celier <celier@adacore.com> * bindgen.adb: Remove any processing related to g-trasym * Makefile.rtl: Add g-trasym.o to GNATRTL_NONTASKING_OBJS * mlib-prj.adb: Remove any processing related to g-trasym. From-SVN: r179898
Diffstat (limited to 'gcc/ada/par-util.adb')
-rw-r--r--gcc/ada/par-util.adb39
1 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb
index 6a0e8ef..32a3a88 100644
--- a/gcc/ada/par-util.adb
+++ b/gcc/ada/par-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, 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- --
@@ -169,6 +169,43 @@ package body Util is
end Check_Bad_Layout;
--------------------------
+ -- Check_Future_Keyword --
+ --------------------------
+
+ procedure Check_Future_Keyword is
+ begin
+ -- Ada 2005 (AI-284): Compiling in Ada95 mode we warn that INTERFACE,
+ -- OVERRIDING, and SYNCHRONIZED are new reserved words.
+
+ if Ada_Version = Ada_95
+ and then Warn_On_Ada_2005_Compatibility
+ then
+ if Token_Name = Name_Overriding
+ or else Token_Name = Name_Synchronized
+ or else (Token_Name = Name_Interface
+ and then Prev_Token /= Tok_Pragma)
+ then
+ Error_Msg_N ("& is a reserved word in Ada 2005?", Token_Node);
+ end if;
+ end if;
+
+ -- Similarly, warn about Ada 2012 reserved words
+
+ if Ada_Version in Ada_95 .. Ada_2005
+ and then Warn_On_Ada_2012_Compatibility
+ then
+ if Token_Name = Name_Some then
+ Error_Msg_N ("& is a reserved word in Ada 2012?", Token_Node);
+ end if;
+ end if;
+
+ -- Note: we deliberately do not emit these warnings when operating in
+ -- Ada 83 mode because in that case we assume the user is building
+ -- legacy code anyway.
+
+ end Check_Future_Keyword;
+
+ --------------------------
-- Check_Misspelling_Of --
--------------------------