[Ada] Unnesting: do not emit warnings for access to subprograms
authorEd Schonberg <schonberg@adacore.com>
Tue, 21 Aug 2018 14:46:54 +0000 (14:46 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 21 Aug 2018 14:46:54 +0000 (14:46 +0000)
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* freeze.adb: Remove warnings for access to subprograms when
unnesting is active.

From-SVN: r263720

gcc/ada/ChangeLog
gcc/ada/freeze.adb

index d0ad28d3ebadc998ce639727c7822c77d583f285..9737c07239442671a6efe433512502bf2ecc5e5f 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-21  Ed Schonberg  <schonberg@adacore.com>
+
+       * freeze.adb: Remove warnings for access to subprograms when
+       unnesting is active.
+
 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_aggr.adb (Expand_Array_Aggregate): If the component type
index 9979cbf71e1bae365ab8ca1d4305b69cd8356d2c..ea9454a98151bd5980dbd032abcbad3530f0934c 100644 (file)
@@ -3611,10 +3611,14 @@ package body Freeze is
 
                Error_Msg_Qual_Level := 1;
 
-               --  Check suspicious use of fat C pointer
+               --  Check suspicious use of fat C pointer, but do not emit
+               --  a warning on an access to subprogram when unnesting is
+               --  active.
 
                if Is_Access_Type (F_Type)
                  and then Esize (F_Type) > Ttypes.System_Address_Size
+                 and then (not Unnest_Subprogram_Mode
+                             or else not Is_Access_Subprogram_Type (F_Type))
                then
                   Error_Msg_N
                     ("?x?type of & does not correspond to C pointer!", Formal);