diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-22 14:12:55 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-22 14:12:55 +0000 |
commit | ad6b44d8902bec8c9e14046133ecfff3513e00b6 (patch) | |
tree | 0ca3eebfb23972eb52bb66139e169b1ffc2e8701 /gcc/ada/par-ch3.adb | |
parent | 3ad9c37507003591d3eab89c6b0a3c8373086ecf (diff) | |
download | gcc-ad6b44d8902bec8c9e14046133ecfff3513e00b6.tar.gz |
2012-02-22 Robert Dewar <dewar@adacore.com>
* exp_util.adb, make.adb, sem_dim.adb, sem_ch4.adb, exp_disp.adb: Minor
reformatting.
2012-02-22 Geert Bosch <bosch@adacore.com>
* g-bytswa-x86.adb, g-bytswa.adb, gcc-interface/Makefile.in: Remove
x86-specific version of byteswap and use GCC builtins instead.
2012-02-22 Tristan Gingold <gingold@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type,
E_Array_Type]: Translate component ealier.
2012-02-22 Robert Dewar <dewar@adacore.com>
* par-ch3.adb (P_Signed_Integer_Type_Definition): Specialize
error message for 'Range.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch3.adb')
-rw-r--r-- | gcc/ada/par-ch3.adb | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index ef017f08960..bfc4f592bf3 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2012, 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- -- @@ -2279,13 +2279,30 @@ package body Ch3 is Scan; -- past RANGE end if; - Expr_Node := P_Expression; - Check_Simple_Expression (Expr_Node); - Set_Low_Bound (Typedef_Node, Expr_Node); - T_Dot_Dot; - Expr_Node := P_Expression; - Check_Simple_Expression (Expr_Node); - Set_High_Bound (Typedef_Node, Expr_Node); + Expr_Node := P_Expression_Or_Range_Attribute; + + -- Range case (not permitted by the grammar, this is surprising but + -- the grammar in the RM is as quoted above, and does not allow Range). + + if Expr_Form = EF_Range_Attr then + Error_Msg_N + ("Range attribute not allowed here, use First .. Last", Expr_Node); + Set_Low_Bound (Typedef_Node, Expr_Node); + Set_Attribute_Name (Expr_Node, Name_First); + Set_High_Bound (Typedef_Node, Copy_Separate_Tree (Expr_Node)); + Set_Attribute_Name (High_Bound (Typedef_Node), Name_Last); + + -- Normal case of explicit range + + else + Check_Simple_Expression (Expr_Node); + Set_Low_Bound (Typedef_Node, Expr_Node); + T_Dot_Dot; + Expr_Node := P_Expression; + Check_Simple_Expression (Expr_Node); + Set_High_Bound (Typedef_Node, Expr_Node); + end if; + return Typedef_Node; end P_Signed_Integer_Type_Definition; |