From 913e4b3617fe7f46fbdbb72b010cf6cf7201d329 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Mon, 23 Jan 2017 12:00:26 +0000 Subject: sem_ch4.adb (Try_Primitive_Operations, [...]): argument is valid if it is a derived type with unknown discriminants that... 2017-01-23 Ed Schonberg * 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 --- gcc/ada/sem_ch4.adb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/ada/sem_ch4.adb') diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 26d78b6..7a26661 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -9294,6 +9294,13 @@ package body Sem_Ch4 is or else Base_Type (Obj_Type) = Typ or else Corr_Type = Typ + -- Object may be of a derived type whose parent has unknown + -- discriminants, in which case the type matches the + -- underlying record view of its base. + + or else (Has_Unknown_Discriminants (Typ) + and then Typ = Underlying_Record_View (Base_Type (Obj_Type))) + -- Prefix can be dereferenced or else -- cgit v1.1