]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/sem_ch4.adb
ada: Constant_Indexing used when context requires a variable
[gcc.git] / gcc / ada / sem_ch4.adb
index 83705b9dae1b10296745dc7b29b2d692af1bfac6..d506944bc8dd54393f061c7278787063b375cf55 100644 (file)
@@ -8473,9 +8473,21 @@ package body Sem_Ch4 is
             --  resolution does not depend on the type of the parameter that
             --  includes the indexing operation.
 
-            elsif Nkind (Parent (Par)) in N_Subprogram_Call
-              and then Is_Entity_Name (Name (Parent (Par)))
-            then
+            elsif Nkind (Parent (Par)) in N_Subprogram_Call then
+
+               if not Is_Entity_Name (Name (Parent (Par))) then
+
+                  --  ??? We don't know what to do with an N_Selected_Component
+                  --  node for a prefixed-notation call to AA.BB where AA's
+                  --  type is known, but BB has not yet been resolved. In that
+                  --  case, the preceding Is_Entity_Name call returns False.
+                  --  Incorrectly returning False here will usually work
+                  --  better than incorrectly returning True, so that's what
+                  --  we do for now.
+
+                  return False;
+               end if;
+
                declare
                   Proc : Entity_Id;
 
This page took 0.028448 seconds and 5 git commands to generate.