aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/stand.ads
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2013-04-11 10:39:15 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-11 12:39:15 +0200
commitc8d636509a850e8e90b995426241fa5054728367 (patch)
treea1de6d2f72ee6430d13b59a7e4b07057eea1c2e5 /gcc/ada/stand.ads
parent845f06e288259ec222b6b6bf00cbe889397f8938 (diff)
downloadgcc-c8d636509a850e8e90b995426241fa5054728367.zip
gcc-c8d636509a850e8e90b995426241fa5054728367.tar.gz
gcc-c8d636509a850e8e90b995426241fa5054728367.tar.bz2
exp_ch11.ads, [...] (Expand_N_Raise_Expression): New procedure.
2013-04-11 Robert Dewar <dewar@adacore.com> * exp_ch11.ads, exp_ch11.adb (Expand_N_Raise_Expression): New procedure. * exp_util.adb (Insert_Actions): Add entry for N_Raise_Expression. * expander.adb: Add call to Expand_N_Raise_Expression. * par-ch11.adb (P_Raise_Expression): New procedure. * par-ch4.adb (P_Relation): Handle Raise_Expression. * par.adb (P_Raise_Expression): New procedure. * sem.adb: Add handling for N_Raise_Expression. * sem_ch11.ads, sem_ch11.adb (Analyze_Raise_Expression): New procedure. * sem_res.adb (Resolve): Add handling for N_Raise_Expression. * sinfo.ads, sinfo.adb (N_Raise_Expression): New node. * sprint.adb (Sprint_Node_Actual): Add handling for N_Raise_Expression. * stand.ads (Any_Type): Document use with N_Raise_Expression. From-SVN: r197764
Diffstat (limited to 'gcc/ada/stand.ads')
-rw-r--r--gcc/ada/stand.ads25
1 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads
index 16f388d..0eeeed6 100644
--- a/gcc/ada/stand.ads
+++ b/gcc/ada/stand.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, 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- --
@@ -362,10 +362,25 @@ package Stand is
-- identifier references to prevent cascaded errors.
Any_Type : Entity_Id;
- -- Used to represent some unknown type. Plays an important role in
- -- avoiding cascaded errors, since any node that remains labeled with
- -- this type corresponds to an already issued error message. Any_Type
- -- is propagated to avoid cascaded errors from a single type error.
+ -- Used to represent some unknown type. Any_Type is the type of an
+ -- unresolved operator, and it is the type of a node where a type error
+ -- has been detected. Any_Type plays an important role in avoiding
+ -- cascaded errors, because it is compatible with all other types, and is
+ -- propagated to any expression that has a subexpression of Any_Type.
+ -- When resolving operators, Any_Type is the initial type of the node
+ -- before any of its candidate interpretations has been examined. If after
+ -- examining all of them the type is still Any_Type, the node has no
+ -- possible interpretation and an error can be emitted (and Any_Type will
+ -- be propagated upwards).
+
+ -- There is one situation in which Any_Type is used to legitimately
+ -- represent a case where the type is not known pre-resolution, and
+ -- that is for the N_Raise_Expression node. In this case, the Etype
+ -- being set to Any_Type is normal and does not represent an error.
+ -- In particular, it is compatible with the type of any constituend of
+ -- the enclosing expression, if any. The type is eventually replaced
+ -- with the type of the context, which plays no role in the resolution
+ -- of the Raise_Expression.
Any_Access : Entity_Id;
-- Used to resolve the overloaded literal NULL