diff mbox series

[Ada] Spurious error in inlining for GNATprove on prefix call notation

Message ID 20180521150212.GA78215@adacore.com
State New
Headers show
Series [Ada] Spurious error in inlining for GNATprove on prefix call notation | expand

Commit Message

Pierre-Marie de Rodat May 21, 2018, 3:02 p.m. UTC
During the special inlining done in GNATprove mode, a call in prefix
notation leads to a spurious error. Now fixed.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-05-21  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
	call notation in inlined call in GNATprove mode.
diff mbox series

Patch

--- gcc/ada/sem_ch6.adb
+++ gcc/ada/sem_ch6.adb
@@ -1933,7 +1933,9 @@  package body Sem_Ch6 is
             begin
                if Is_Tagged_Type (Typ)
                  and then Present (First_Formal (Subp))
-                 and then Etype (First_Formal (Subp)) = Typ
+                 and then (Etype (First_Formal (Subp)) = Typ
+                             or else
+                           Class_Wide_Type (Etype (First_Formal (Subp))) = Typ)
                  and then Try_Object_Operation (P)
                then
                   return;