summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 09:18:12 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 09:18:12 +0000
commitf1f3250a6c57dbc6e595773adf43a5181dfae467 (patch)
treea2002af452b1527d28b25193a57cac52564eb312 /gcc/ada/par-ch13.adb
parent77f9be2dab5055773bb3411b708c79f2a76c3590 (diff)
downloadgcc-f1f3250a6c57dbc6e595773adf43a5181dfae467.tar.gz
2011-08-04 Yannick Moy <moy@adacore.com>
* par-ch13.adb (Aspect_Specifications_Present): recognize "with Identifier'Class =>" as an aspect, so that a meaningful warning is issued in Strict mode. * par.adb: Fix typos in comments. 2011-08-04 Yannick Moy <moy@adacore.com> * sem_attr.adb (Result): modify error message to take into account Post aspect when compiling Ada 2012 (or newer) code. 2011-08-04 Nicolas Roche <roche@adacore.com> * env.c (__gnat_clearenv): Avoid use of dynamic size array in order to remove need for GCC exceptions. 2011-08-04 Vincent Celier <celier@adacore.com> * makeutl.adb (Do_Complete): Call Debug_Output with the name of the project, not the source file name. * prj.adb (Find_Sources.Look_For_Sources): If the source has been excluded, continue looking. This excluded source will only be returned if there is no other source with the same base name that is not locally removed. 2011-08-04 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Intrinsic_Operator): if the result type is private and one of the operands is a real literal, use a qualified expression rather than a conversion which is not meaningful to the back-end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177342 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch13.adb')
-rw-r--r--gcc/ada/par-ch13.adb30
1 files changed, 23 insertions, 7 deletions
diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb
index 099f0e44b15..ecbf58f980e 100644
--- a/gcc/ada/par-ch13.adb
+++ b/gcc/ada/par-ch13.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- --
@@ -89,9 +89,9 @@ package body Ch13 is
Result := Token = Tok_Arrow;
end if;
- -- If earlier than Ada 2012, check for valid aspect identifier followed
- -- by an arrow, and consider that this is still an aspect specification
- -- so we give an appropriate message.
+ -- If earlier than Ada 2012, check for valid aspect identifier (possibly
+ -- completed with 'CLASS) followed by an arrow, and consider that this
+ -- is still an aspect specification so we give an appropriate message.
else
if Get_Aspect_Id (Token_Name) = No_Aspect then
@@ -100,10 +100,26 @@ package body Ch13 is
else
Scan; -- past aspect name
- if Token /= Tok_Arrow then
- Result := False;
+ Result := False;
- else
+ if Token = Tok_Arrow then
+ Result := True;
+
+ elsif Token = Tok_Apostrophe then
+ Scan; -- past apostrophe
+
+ if Token = Tok_Identifier
+ and then Token_Name = Name_Class
+ then
+ Scan; -- past CLASS
+
+ if Token = Tok_Arrow then
+ Result := True;
+ end if;
+ end if;
+ end if;
+
+ if Result then
Restore_Scan_State (Scan_State);
Error_Msg_SC ("|aspect specification is an Ada 2012 feature");
Error_Msg_SC ("\|unit must be compiled with -gnat2012 switch");