aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-05 16:29:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-05 16:29:43 +0200
commitd50f4827c7062e3247baf493e646c365114c28cd (patch)
treee4f47a16c8f93fc574f67b26cbcf1e9166278c08 /gcc/ada/par-ch4.adb
parentefe05dfc95b60b57abb6c57055982e25dc09c91e (diff)
downloadgcc-d50f4827c7062e3247baf493e646c365114c28cd.zip
gcc-d50f4827c7062e3247baf493e646c365114c28cd.tar.gz
gcc-d50f4827c7062e3247baf493e646c365114c28cd.tar.bz2
[multiple changes]
2011-08-05 Bob Duff <duff@adacore.com> * sinfo.ads, sinfo.adb (Subpool_Handle_Name): New attribute for subpools. * par-ch4.adb (P_Allocator): Parse new subpool specification syntax. 2011-08-05 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Container_Indexing): New procedure to implement the general indexing aspects of Ada2012. Called when analyzing indexed components when other interpretations fail. * sem_ch8.adb (Find_Direct_Name): check for implicit dereference only in an expression context where overloading is meaningful. This excludes the occurrence in an aspect specification (efficiency only). * sem_attr.adb (Analyze_Attribute): indicate that the attributes related to iterators can be set by an attribute specification, but cannot be queried. * sem_ch13.adb (Analyze_Aspect_Specifications): handle Constant_Indexing and Variable_Indexing. (Check_Indexing_Functions): New procedure to perform legality checks. Additional semantic checks at end of declarations. From-SVN: r177446
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r--gcc/ada/par-ch4.adb22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 125a9c4..cbe68cf 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -2810,7 +2810,10 @@ package body Ch4 is
--------------------
-- ALLOCATOR ::=
- -- new [NULL_EXCLUSION] SUBTYPE_INDICATION | new QUALIFIED_EXPRESSION
+ -- new [SUBPOOL_SPECIFICATION] SUBTYPE_INDICATION
+ -- | new [SUBPOOL_SPECIFICATION] QUALIFIED_EXPRESSION
+ --
+ -- SUBPOOL_SPECIFICATION ::= (subpool_handle_NAME)
-- The caller has checked that the initial token is NEW
@@ -2825,8 +2828,25 @@ package body Ch4 is
Alloc_Node := New_Node (N_Allocator, Token_Ptr);
T_New;
+ -- Scan subpool_specification if present (Ada 2012 (AI05-0111-3))
+
-- Scan Null_Exclusion if present (Ada 2005 (AI-231))
+ if Token = Tok_Left_Paren then
+ Scan; -- past (
+ Set_Subpool_Handle_Name (Alloc_Node, P_Name);
+ T_Right_Paren;
+
+ if Ada_Version < Ada_2012 then
+ Error_Msg_N
+ ("|subpool specification is an Ada 2012 feature",
+ Subpool_Handle_Name (Alloc_Node));
+ Error_Msg_N
+ ("\|unit must be compiled with -gnat2012 switch",
+ Subpool_Handle_Name (Alloc_Node));
+ end if;
+ end if;
+
Null_Exclusion_Present := P_Null_Exclusion;
Set_Null_Exclusion_Present (Alloc_Node, Null_Exclusion_Present);
Type_Node := P_Subtype_Mark_Resync;