aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-11-13 14:14:44 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-11-13 14:14:44 +0100
commit90b510e4aa33eec927376c42e608a5f569d264c7 (patch)
treeaf2453061ba4ef908f40aa510009165f091f8ec0 /gcc/ada/sem_ch4.adb
parent6672e402095eb9df8517918c58929c145b9c1bc2 (diff)
downloadgcc-90b510e4aa33eec927376c42e608a5f569d264c7.zip
gcc-90b510e4aa33eec927376c42e608a5f569d264c7.tar.gz
gcc-90b510e4aa33eec927376c42e608a5f569d264c7.tar.bz2
[multiple changes]
2015-11-13 Eric Botcazou <ebotcazou@adacore.com> * sigtramp-ios.c, init.c: Minor cosmetic tweaks. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * s-gloloc.adb, g-debpoo.adb: Minor reformatting. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Improve error message for the case the iterable name (array or container) is a component that depends on a discriminant. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Indicate_Name_And_Type): If the analysis of one interpretation succeeds, set type of name in call, for completeness. (Try_Container_Indexing): If there are multiple indexing functions, collect possible interpretations that are compatible with given parameters, and add implicit dereference types when present. * sem_util.adb (Build_Explicit_Dereference): If the expression is an overloaded function call use the given discriminant to resolve the call, and set properly the type of the call and of the resulting dereference. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Pragma Constant_After_Elaboration can now apply to a variable without an initialization expression. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch9.adb (Add_Matching_Formals): Parameter Actuals is now of mode IN OUT. Create a new list when list Actuals is not present. (Build_Contract_Wrapper): Create the wrapper only when the entry has at least on checked contract case or pre/postcondition. Ensure that the call to the original entry lacks an actual parameter list when the entry appears without formal parameters. (Expand_Entry_Declaration): Code cleanup. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Continue the analysis after encountering an illegal aspect Part_Of. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case Overlaps_Storage): Add copies for nodes that represent the integer addresses of the two actuals, to prevent identical nodes in the tree, which the backend cannot handle properly. From-SVN: r230316
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 999a78b..68988d3 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -3073,6 +3073,7 @@ package body Sem_Ch4 is
if not Is_Type (Nam) then
if Is_Entity_Name (Name (N)) then
Set_Entity (Name (N), Nam);
+ Set_Etype (Name (N), Etype (Nam));
elsif Nkind (Name (N)) = N_Selected_Component then
Set_Entity (Selector_Name (Name (N)), Nam);
@@ -7456,6 +7457,9 @@ package body Sem_Ch4 is
end if;
else
+ -- If there are multiple indexing functions, build a function call
+ -- and analyze it for each of the possible interpretations.
+
Indexing :=
Make_Function_Call (Loc,
Name =>
@@ -7464,6 +7468,8 @@ package body Sem_Ch4 is
Set_Parent (Indexing, Parent (N));
Set_Generalized_Indexing (N, Indexing);
+ Set_Etype (N, Any_Type);
+ Set_Etype (Name (Indexing), Any_Type);
declare
I : Interp_Index;
@@ -7473,21 +7479,24 @@ package body Sem_Ch4 is
begin
Get_First_Interp (Func_Name, I, It);
Set_Etype (Indexing, Any_Type);
+
while Present (It.Nam) loop
Analyze_One_Call (Indexing, It.Nam, False, Success);
if Success then
- Set_Etype (Name (Indexing), It.Typ);
- Set_Entity (Name (Indexing), It.Nam);
- Set_Etype (N, Etype (Indexing));
- -- Add implicit dereference interpretation
+ -- Function in current interpretation is a valid candidate.
+ -- Its result type is also a potential type for the
+ -- original Indexed_Component node.
+
+ Add_One_Interp (Name (Indexing), It.Nam, It.Typ);
+ Add_One_Interp (N, It.Nam, It.Typ);
+
+ -- Add implicit dereference interpretation to original node
if Has_Discriminants (Etype (It.Nam)) then
Check_Implicit_Dereference (N, Etype (It.Nam));
end if;
-
- exit;
end if;
Get_Next_Interp (I, It);