summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 16:14:07 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 16:14:07 +0000
commit0fd914d3001d43b3e6c8f9adb895cac8a25d0139 (patch)
tree2ad488591abe1b897e87a50d7a83b1af75a5ff9d /gcc
parent24cddfd6a992441d37ae0edad426b6a24e94ea1d (diff)
downloadgcc-0fd914d3001d43b3e6c8f9adb895cac8a25d0139.tar.gz
2005-03-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_Concatenation): Do not consider operators marked Eliminated as candidates for resolution. Both efficient, and avoids anomalies with operators declared in deleted code. (Process_Implicit_Dereference_Prefix): Use this procedure whenever expansion is disabled (as when compiling a generic) to prevent spurious warnings on prefixes of selected components. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96505 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch4.adb22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 17d9993f329..21b962cc3fa 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -216,8 +216,8 @@ package body Sem_Ch4 is
(E : Entity_Id;
P : Node_Id);
-- Called when P is the prefix of an implicit dereference, denoting an
- -- object E. If in semantics only mode (-gnatc), record that is a
- -- reference to E. Normally, such a reference is generated only when the
+ -- object E. If in semantics only mode (-gnatc or generic), record that is
+ -- a reference to E. Normally, such a reference is generated only when the
-- implicit dereference is expanded into an explicit one. E may be empty,
-- in which case this procedure does nothing.
@@ -1015,10 +1015,19 @@ package body Sem_Ch4 is
end if;
else
- Op_Id := Get_Name_Entity_Id (Name_Op_Concat);
+ Op_Id := Get_Name_Entity_Id (Name_Op_Concat);
while Present (Op_Id) loop
if Ekind (Op_Id) = E_Operator then
- Find_Concatenation_Types (L, R, Op_Id, N);
+
+ -- Do not consider operators declared in dead code, they can
+ -- not be part of the resolution.
+
+ if Is_Eliminated (Op_Id) then
+ null;
+ else
+ Find_Concatenation_Types (L, R, Op_Id, N);
+ end if;
+
else
Analyze_User_Defined_Binary_Op (N, Op_Id);
end if;
@@ -4422,8 +4431,9 @@ package body Sem_Ch4 is
Ref : Node_Id;
begin
- if Operating_Mode = Check_Semantics and then Present (E) then
-
+ if Present (E)
+ and then (Operating_Mode = Check_Semantics or else not Expander_Active)
+ then
-- We create a dummy reference to E to ensure that the reference
-- is not considered as part of an assignment (an implicit
-- dereference can never assign to its prefix). The Comes_From_Source