From a2c314c72b070a170ade9858c6a0ece2105c4508 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 26 Oct 2015 14:26:11 +0100 Subject: [multiple changes] 2015-10-26 Bob Duff * snames.ads-tmpl, aspects.adb, aspects.ads: Add the aspect and pragma names and enter into relevant tables. * sem_ch13.adb (Analyze_Aspect_Specifications): Analyze aspect Predicate_Failure. * sem_prag.adb (Predicate_Failure): Analyze pragma Predicate_Failure. * exp_util.adb (Make_Predicate_Check): When building the Check pragma, if Predicate_Failure has been specified, add the relevant String argument to the pragma. * par-prag.adb (Prag): Add Predicate_Failure to list of pragmas handled during semantic analysis. 2015-10-26 Ed Schonberg * sem_ch5.adb (Analyze_Assignment): If the left-hand side is an indexed component with generalized indexing, discard interpretation that yields a reference type, which is not assignable. This prevent spurious ambiguities when the right-hand side is an aggregate which does not provide a target type. From-SVN: r229358 --- gcc/ada/sem_ch5.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_ch5.adb') diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 3e79179..0c9c56e 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -316,7 +316,18 @@ package body Sem_Ch5 is Get_First_Interp (Lhs, I, It); while Present (It.Typ) loop - if Has_Compatible_Type (Rhs, It.Typ) then + -- An indexed component with generalized indexing is always + -- overloaded with the corresponding dereference. Discard + -- the interpretation that yields a reference type, which + -- is not assignable. + + if Nkind (Lhs) = N_Indexed_Component + and then Present (Generalized_Indexing (Lhs)) + and then Has_Implicit_Dereference (It.Typ) + then + null; + + elsif Has_Compatible_Type (Rhs, It.Typ) then if T1 /= Any_Type then -- An explicit dereference is overloaded if the prefix -- cgit v1.1