aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2013-07-05 08:59:49 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2013-07-05 10:59:49 +0200
commit45c9ce986815135f925dbc0199d3932e860d4a02 (patch)
tree9b44a4953649f2564fdc99c13c12476e643945a2 /gcc/ada
parentfdc4e9d4c5597a6d0b1dffea849b6c6152c4d5bb (diff)
downloadgcc-45c9ce986815135f925dbc0199d3932e860d4a02.zip
gcc-45c9ce986815135f925dbc0199d3932e860d4a02.tar.gz
gcc-45c9ce986815135f925dbc0199d3932e860d4a02.tar.bz2
sem_prag.adb (Analyze_PPC_In_Decl_Part): For a class-wide condition...
2013-07-05 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_PPC_In_Decl_Part): For a class-wide condition, when replacing the name of a formal by a conversion to the class-wide type, exempt selector names that appear in parameter associations. From-SVN: r200689
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_prag.adb6
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 4122896..cc6e97c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2013-07-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_PPC_In_Decl_Part): For a class-wide
+ condition, when replacing the name of a formal by a conversion
+ to the class-wide type, exempt selector names that appear in
+ parameter associations.
+
2013-06-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): Delete.
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index e148d05..0de1eba 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -1749,6 +1749,9 @@ package body Sem_Prag is
-- accessparameter of type access-to-T is interpreted as having
-- type access-to-T'Class. This ensures the expression is well-
-- defined for a primitive subprogram of a type descended from T.
+ -- Note that this replacement is not done for selector names in
+ -- parameter associations. These carry an entity for reference
+ -- purposes, but they semantically they are just identifiers.
-------------
-- Get_ACW --
@@ -1790,6 +1793,9 @@ package body Sem_Prag is
and then Present (Entity (N))
and then Is_Formal (Entity (N))
and then Nkind (Parent (N)) /= N_Type_Conversion
+ and then
+ (Nkind (Parent (N)) /= N_Parameter_Association
+ or else N /= Selector_Name (Parent (N)))
then
if Etype (Entity (N)) = T then
Typ := Class_Wide_Type (T);