]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Subprogram_Variant in ignored ghost code
authorBob Duff <duff@adacore.com>
Tue, 17 Aug 2021 15:02:51 +0000 (11:02 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 1 Oct 2021 06:13:39 +0000 (06:13 +0000)
gcc/ada/

* exp_ch6.adb (Expand_Call_Helper): Do not call
Check_Subprogram_Variant if the subprogram is an ignored ghost
entity. Otherwise the compiler crashes (in debug builds) or
gives strange error messages (in production builds).

gcc/ada/exp_ch6.adb

index ffd14759a7f15b323d69b274063ee302247ecb1b..ce0bb80825d2937ddca76513e1bd6d4088bc13a6 100644 (file)
@@ -4392,6 +4392,7 @@ package body Exp_Ch6 is
       --  the current subprogram is called.
 
       if Is_Subprogram (Subp)
+        and then not Is_Ignored_Ghost_Entity (Subp)
         and then Same_Or_Aliased_Subprograms (Subp, Current_Scope)
       then
          Check_Subprogram_Variant;