]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Bug box for expression function with list comprehension
authorBob Duff <duff@adacore.com>
Tue, 18 Jun 2024 16:53:46 +0000 (12:53 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 2 Jul 2024 13:20:35 +0000 (15:20 +0200)
GNAT crashes on an iterator with a filter inside an expression function
that is the completion of an earlier spec.

gcc/ada/

* freeze.adb (Freeze_Type_Refs): If Node is in N_Has_Etype,
check that it has had its Etype set, because this can be
called early for expression functions that are completions.

gcc/ada/freeze.adb

index 757c16e68391b8e17ae722da56008d41aade3074..7cf7e847677567d45d8a8f2dc54d5de64889c146 100644 (file)
@@ -9137,6 +9137,7 @@ package body Freeze is
          --  that type is not attached to an entity in the construct.
 
          elsif Nkind (Node) in N_Has_Etype
+           and then Present (Etype (Node))
            and then Nkind (Parent (Node)) = N_Iterator_Specification
            and then Node = Name (Parent (Node))
          then