aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_util.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2017-01-23 12:00:26 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 13:00:26 +0100
commit913e4b3617fe7f46fbdbb72b010cf6cf7201d329 (patch)
treea30bc477380cd60dbeb59b86ec2abe49e3833502 /gcc/ada/exp_util.adb
parenta77152ca855e6009a38ee011043465d60ed8f5c2 (diff)
downloadgcc-913e4b3617fe7f46fbdbb72b010cf6cf7201d329.zip
gcc-913e4b3617fe7f46fbdbb72b010cf6cf7201d329.tar.gz
gcc-913e4b3617fe7f46fbdbb72b010cf6cf7201d329.tar.bz2
sem_ch4.adb (Try_Primitive_Operations, [...]): argument is valid if it is a derived type with unknown discriminants that...
2017-01-23 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Primitive_Operations, Is_Valid_First_Argument_Of): argument is valid if it is a derived type with unknown discriminants that matches its underlying record view. * exp_util.adb (Expand_Subtype_From_Expr): Do not expand expression if its type is derived from a limited type with unknown discriminants, because the expansion (which is a call) must be expanded in the enclosing context to add the proper build- in-place parameters to the call. * lib.ads, exp_ch9.adb: Minor fixes in comments. From-SVN: r244790
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r--gcc/ada/exp_util.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index f181bede..e828a1e 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -3782,7 +3782,13 @@ package body Exp_Util is
then
-- Nothing to be done if no underlying record view available
- if No (Underlying_Record_View (Unc_Type)) then
+ -- If this is a limited type derived from a type with unknown
+ -- discriminants, do not expand either, so that subsequent
+ -- expansion of the call can add build-in-place parameters to call.
+
+ if No (Underlying_Record_View (Unc_Type))
+ or else Is_Limited_Type (Unc_Type)
+ then
null;
-- Otherwise use the Underlying_Record_View to create the proper