aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:43:04 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:43:04 +0200
commitf5afb270e6dae6d56ddad1fb2b8661dffe03259c (patch)
treed953455348b6692356e9d3505911569c6c09eb5a /gcc/ada/sem_res.adb
parentdb72f10a75e878cf0c678e21bdc4b7222acca271 (diff)
downloadgcc-f5afb270e6dae6d56ddad1fb2b8661dffe03259c.zip
gcc-f5afb270e6dae6d56ddad1fb2b8661dffe03259c.tar.gz
gcc-f5afb270e6dae6d56ddad1fb2b8661dffe03259c.tar.bz2
[multiple changes]
2011-08-02 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Logical_Op): ensure N is a binary operator before accessing operands. * sem_util.adb (Is_SPARK_Initialization_Expr): follow original nodes to decide whether an initialization expression respects SPARK rules, as the plain node is the expanded one. This allows for more valid warnings to be issued. * gnat_rm.texi: Minor update. 2011-08-02 Arnaud Charlet <charlet@adacore.com> * sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Revert previous change. 2011-08-02 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, sem_ch4.adb: Minor reformatting. 2011-08-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): Reformatting. Wrap the original loop statements and the element renaming declaration with a block when the element type is controlled. 2011-08-02 Yannick Moy <moy@adacore.com> * sinfo.ads: Minor formatting. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Add_Association): if the association has a box and no expression, use the Sloc of the aggregate itself for the new association. * errout.adb (First_Node): Exclude nodes with no Sloc, and always use the Original_Node. From-SVN: r177153
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb33
1 files changed, 17 insertions, 16 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 3f778c3..4d54142 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -7324,22 +7324,23 @@ package body Sem_Res is
-- bounds. Of course the types have to match, so only check if operands
-- are compatible and the node itself has no errors.
- declare
- Left_Typ : constant Node_Id := Etype (Left_Opnd (N));
- Right_Typ : constant Node_Id := Etype (Right_Opnd (N));
- begin
- if Is_Array_Type (B_Typ)
- and then Nkind (N) in N_Binary_Op
- and then Base_Type (Left_Typ) = Base_Type (Right_Typ)
- and then Left_Typ /= Any_Composite -- or else Left_Opnd in error
- and then Right_Typ /= Any_Composite -- or else Right_Opnd in error
- and then not Matching_Static_Array_Bounds (Left_Typ, Right_Typ)
- then
- Check_Formal_Restriction
- ("array types should have matching static bounds", N);
- end if;
- end;
-
+ if Is_Array_Type (B_Typ)
+ and then Nkind (N) in N_Binary_Op
+ then
+ declare
+ Left_Typ : constant Node_Id := Etype (Left_Opnd (N));
+ Right_Typ : constant Node_Id := Etype (Right_Opnd (N));
+ begin
+ if Base_Type (Left_Typ) = Base_Type (Right_Typ)
+ and then Left_Typ /= Any_Composite -- or Left_Opnd in error
+ and then Right_Typ /= Any_Composite -- or Right_Opnd in error
+ and then not Matching_Static_Array_Bounds (Left_Typ, Right_Typ)
+ then
+ Check_Formal_Restriction
+ ("array types should have matching static bounds", N);
+ end if;
+ end;
+ end if;
end Resolve_Logical_Op;
---------------------------