[Ada] Spurious error in inlining for GNATprove on prefix call notation
authorYannick Moy <moy@adacore.com>
Mon, 21 May 2018 14:50:59 +0000 (14:50 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 21 May 2018 14:50:59 +0000 (14:50 +0000)
During the special inlining done in GNATprove mode, a call in prefix
notation leads to a spurious error. Now fixed.

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.

From-SVN: r260454

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb

index 71ef1ba..f7f92af 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-04  Yannick Moy  <moy@adacore.com>
+
+       * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
+       call notation in inlined call in GNATprove mode.
+
 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * einfo.adb (Is_External_State): An abstract state is also external
index e621ac3..e334920 100644 (file)
@@ -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;