aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-16 14:32:52 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-16 14:32:52 +0200
commite3d9f448435324040b2305b6017daa47d75e291c (patch)
tree493650f7139305f7406b89a0883995b1877f7d76 /gcc/ada/sem_ch4.adb
parent57d3adcd5e4e9e3b9b0f05fc5051fcbf0bb88f09 (diff)
downloadgcc-e3d9f448435324040b2305b6017daa47d75e291c.zip
gcc-e3d9f448435324040b2305b6017daa47d75e291c.tar.gz
gcc-e3d9f448435324040b2305b6017daa47d75e291c.tar.bz2
[multiple changes]
2015-10-16 Arnaud Charlet <charlet@adacore.com> * usage.adb, debug.adb, a-except.adb, a-except.ads, a-except-2005.adb, a-except-2005.ads, s-imgrea.adb: Minor code clean ups related to jgnat/dotnet removal. 2015-10-16 Arnaud Charlet <charlet@adacore.com> * s-osprim-vxworks.adb, s-osprim-darwin.adb, s-tadeca.adb, s-osprim-unix.adb, s-osprim-solaris.adb, s-osprim-posix.adb, s-osprim.ads (Monotonic_Clock): Removed, unused. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Object_Operation, Try_One_Interpretation): Do not reset the Obj_Type of the prefix if an interpretation involves an untagged type, to prevent a crash when analyzing an illegal program in All_Errors mode. 2015-10-16 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_N_Expression_With_Actions): Force the evaluation of the expression when its type is Boolean. (Force_Boolean_Evaluation): New routine. 2015-10-16 Bob Duff <duff@adacore.com> * sem_util.adb (Has_Discrim_Dep_Array): Remove this function, and the call. No longer needed now that the back end can handle such things. Should result in further speedups in some cases. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Build_Predicate_Functions): If expression for predicate is side-effect free, indicate that the predicate function is pure, to allow for optimization of redundant predicate checks. From-SVN: r228881
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 473d65ef..0c4a901 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -8135,6 +8135,12 @@ package body Sem_Ch4 is
-----------------------------------
procedure Try_One_Prefix_Interpretation (T : Entity_Id) is
+
+ -- If the interpretation does not have a valid candidate type,
+ -- preserve current value of Obj_Type for subsequent errors.
+
+ Prev_Obj_Type : constant Entity_Id := Obj_Type;
+
begin
Obj_Type := T;
@@ -8167,6 +8173,10 @@ package body Sem_Ch4 is
if not Is_Tagged_Type (Obj_Type)
or else Is_Incomplete_Type (Obj_Type)
then
+
+ -- Restore previous type if current one is not legal candidate.
+
+ Obj_Type := Prev_Obj_Type;
return;
end if;