]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix support for prefixed call with incomplete type declarations
authorYannick Moy <moy@adacore.com>
Mon, 25 Oct 2021 10:48:22 +0000 (12:48 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 9 Nov 2021 09:44:46 +0000 (09:44 +0000)
gcc/ada/

* sem_ch3.adb (Analyze_Incomplete_Type_Decl): Add the missing
initialization.

gcc/ada/sem_ch3.adb

index 152ef83387dcebc0c44bc2d487de268c26678229..ff3da3859437da8d61d3bbb93ca6d634cfb96579 100644 (file)
@@ -3506,6 +3506,15 @@ package body Sem_Ch3 is
          Set_Is_Tagged_Type (T, True);
          Set_No_Tagged_Streams_Pragma (T, No_Tagged_Streams);
          Make_Class_Wide_Type (T);
+      end if;
+
+      --  For tagged types, or when prefixed-call syntax is allowed for
+      --  untagged types, initialize the list of primitive operations to
+      --  an empty list.
+
+      if Tagged_Present (N)
+        or else Extensions_Allowed
+      then
          Set_Direct_Primitive_Operations (T, New_Elmt_List);
       end if;