]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix internal error on invalid prefix with assertions enabled
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Oct 2024 10:44:47 +0000 (11:44 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:05:44 +0000 (14:05 +0100)
This happens for example with:

package Q3 is
  type Types is (One, Two);
end Q3;

with Q3;

package P3 is
  Kind : Q3.Types := Q3.Types.One;
end P3;

and prevents the error from being given.

gcc/ada/ChangeLog:

PR ada/112979
* sem_ch8.adb (Find_Selected_Component): Try to recognize the
object operation notation only if the selector is a subprogram.

gcc/ada/sem_ch8.adb

index 2007db368edfdcd5fb2d55d137218faa486a18fb..449bfa897351d7a8f9e4c15ecaef0d3d783a76ec 100644 (file)
@@ -8535,7 +8535,7 @@ package body Sem_Ch8 is
                         Current_Entity (Selector_Name (N));
                begin
                   if Present (F)
-                    and then Is_Overloadable (F)
+                    and then Is_Subprogram (F)
                     and then Present (First_Entity (F))
                     and then not Is_Tagged_Type (Etype (First_Entity (F)))
                   then