aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 16:25:44 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 16:25:44 +0100
commit90b51aaf6383fab0d308a3ae238a45d7a50933b4 (patch)
tree9e69f6d6604fa710148467001bcae9948127dc8a /gcc/ada/sem_res.adb
parent2838fa930c8c9210ee4a81c1c22a6406a9ce2f0f (diff)
downloadgcc-90b51aaf6383fab0d308a3ae238a45d7a50933b4.zip
gcc-90b51aaf6383fab0d308a3ae238a45d7a50933b4.tar.gz
gcc-90b51aaf6383fab0d308a3ae238a45d7a50933b4.tar.bz2
[multiple changes]
2014-01-20 Robert Dewar <dewar@adacore.com> * s-taasde.ads, gnat_ugn.texi, s-tadeca.adb, sem_res.adb, s-tadeca.ads: Minor reformatting and code clean up. 2014-01-20 Arnaud Charlet <charlet@adacore.com> * sem_cat.adb (Validate_Object_Declaration): Relax semantics of objects of private type if Relaxed_RM_Semantics. From-SVN: r206823
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb39
1 files changed, 21 insertions, 18 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 56b6aee..6861f1a 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2156,20 +2156,6 @@ package body Sem_Res is
-- First matching interpretation
if not Found then
- -- If the current statement is part of a predefined library
- -- unit, then all interpretations which come from user level
- -- packages should not be considered. User-defined operators
- -- may appear anywhere in the homonym list. This exclusion
- -- does not apply in an instance, where an actual may come
- -- from a local declaration.
-
- if From_Lib
- and then not Comes_From_Predefined_Lib_Unit (It.Nam)
- and then not In_Instance
- then
- goto Continue;
- end if;
-
Found := True;
I1 := I;
Seen := It.Nam;
@@ -2181,12 +2167,29 @@ package body Sem_Res is
-- some more obscure cases are handled in Disambiguate.
else
- if From_Lib
- and then not Comes_From_Predefined_Lib_Unit (It.Nam)
- then
- goto Continue;
+ -- If the current statement is part of a predefined library
+ -- unit, then all interpretations which come from user level
+ -- packages should not be considered. Check previous and
+ -- current one.
+
+ if From_Lib then
+ if not Comes_From_Predefined_Lib_Unit (It.Nam) then
+ goto Continue;
+
+ elsif not Comes_From_Predefined_Lib_Unit (Seen) then
+
+ -- Previous interpretation must be discarded.
+
+ I1 := I;
+ Seen := It.Nam;
+ Expr_Type := It.Typ;
+ Set_Entity (N, Seen);
+ goto Continue;
+ end if;
end if;
+ -- Otherwise apply further disambiguation steps.
+
Error_Msg_Sloc := Sloc (Seen);
It1 := Disambiguate (N, I1, I, Typ);