aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch12.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2007-06-06 12:40:12 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:40:12 +0200
commitf92f17e6e943377eb2e7b43f5de31ceda409c6cc (patch)
tree703cfa5351f121ff7972a45622d5f73f9630e489 /gcc/ada/par-ch12.adb
parentc7ce71c2263051ea52654243916c7e61640a8a03 (diff)
downloadgcc-f92f17e6e943377eb2e7b43f5de31ceda409c6cc.zip
gcc-f92f17e6e943377eb2e7b43f5de31ceda409c6cc.tar.gz
gcc-f92f17e6e943377eb2e7b43f5de31ceda409c6cc.tar.bz2
par-ch12.adb (P_Generic_Associations): The source position of an Others association is that of the others keyword...
2007-04-20 Ed Schonberg <schonberg@adacore.com> Robert Dewar <dewar@adacore.com> * par-ch12.adb (P_Generic_Associations): The source position of an Others association is that of the others keyword, not that of the token that follows the box. (P_Formal_Type_Definition): Handle formal access types that carry a not null indicator. * par-ch3.adb (P_Known_Discriminant_Part_Opt, P_Component_Items): If multiple identifier are present, save Scan_State before scanning the colon, to ensure that separate trees are constructed for each declaration. (P_Identifier_Declarations): For object declaration, set new flag Has_Init_Expression if initialization expression present. (P_Null_Exclusion): Properly diagnose NOT NULL coming before NULL Improve NOT NULL error messages From-SVN: r125439
Diffstat (limited to 'gcc/ada/par-ch12.adb')
-rw-r--r--gcc/ada/par-ch12.adb18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index 84be97a..d71b40d 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -338,7 +338,7 @@ package body Ch12 is
if Ada_Version < Ada_05 then
Error_Msg_SP
("partial parametrization of formal packages" &
- " is an Ada 2005 extension");
+ " is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
@@ -357,7 +357,9 @@ package body Ch12 is
Scan; -- past box
end if;
- return New_Node (N_Others_Choice, Token_Ptr);
+ -- Source position of the others choice is beginning of construct
+
+ return New_Node (N_Others_Choice, Sloc (Generic_Assoc_Node));
end if;
if Token in Token_Class_Desig then
@@ -679,6 +681,18 @@ package body Ch12 is
when Tok_New =>
return P_Formal_Derived_Type_Definition;
+ when Tok_Not =>
+ if P_Null_Exclusion then
+ Typedef_Node := P_Access_Type_Definition;
+ Set_Null_Exclusion_Present (Typedef_Node);
+ return Typedef_Node;
+
+ else
+ Error_Msg_SC ("expect valid formal access definition!");
+ Resync_Past_Semicolon;
+ return Error;
+ end if;
+
when Tok_Private |
Tok_Tagged =>
return P_Formal_Private_Type_Definition;