2019-10-10 Yannick Moy <moy@adacore.com>
gcc/ada/
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not peek
under private types whose completion is SPARK_Mode Off.
From-SVN: r276833
-2019-10-10 Gary Dismukes <dismukes@adacore.com>
+2019-10-10 Yannick Moy <moy@adacore.com>
- * exp_ch4.adb, sem_cat.adb, sem_ch12.adb, sem_ch3.adb,
- sem_ch6.adb, sem_prag.adb, sem_util.adb, sem_util.ads: Minor
- typo fixes.
\ No newline at end of file
+ * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not peek
+ under private types whose completion is SPARK_Mode Off.
\ No newline at end of file
if No (Underlying_Type (Typ)) then
return True;
+
+ -- Do not peek under a private type if its completion has
+ -- SPARK_Mode Off. In such a case, a deep type is considered
+ -- by GNATprove to be not deep.
+
+ elsif Present (Full_View (Typ))
+ and then Present (SPARK_Pragma (Full_View (Typ)))
+ and then Get_SPARK_Mode_From_Annotation
+ (SPARK_Pragma (Full_View (Typ))) = Off
+ then
+ return False;
+
+ -- Otherwise peek under the private type.
+
else
return Is_Deep (Underlying_Type (Typ));
end if;