[Ada] Crash when specifying an abstract subprogram with Stream_Convert
authorArnaud Charlet <charlet@adacore.com>
Thu, 25 Jun 2020 09:36:54 +0000 (05:36 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 16 Oct 2020 07:31:17 +0000 (03:31 -0400)
gcc/ada/

* sem_prag.adb (Check_OK_Stream_Convert_Function): Check for
abstract subprograms.

gcc/ada/sem_prag.adb

index b3fa7344dacfaf2af8529e91a77316833cb68989..38761983508ad072ac4769572631006c2524ce8f 100644 (file)
@@ -23719,6 +23719,9 @@ package body Sem_Prag is
                   Error_Pragma_Arg
                     ("argument for pragma% must be function of one argument",
                      Arg);
+               elsif Is_Abstract_Subprogram (Ent) then
+                  Error_Pragma_Arg
+                    ("argument for pragma% cannot be abstract", Arg);
                end if;
             end Check_OK_Stream_Convert_Function;