Inside GNATprove, inlining may cause use-clauses to be added in contexts
where the entities are already visible. Do not emit warnings about unused
use-clauses in these contexts, similar to what is done for instances of
generics.

There is no test as only GNATprove is impacted.

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

2017-11-08  Yannick Moy  <m...@adacore.com>

        * sem_ch8.adb (Use_One_Type, Update_Use_Clause_Chain): Do not report
        about unused use-type or use-package clauses inside inlined bodies.

Index: sem_ch8.adb
===================================================================
--- sem_ch8.adb (revision 254523)
+++ sem_ch8.adb (working copy)
@@ -9057,6 +9057,7 @@
               and then Comes_From_Source (Curr)
               and then not Is_Effective_Use_Clause (Curr)
               and then not In_Instance
+              and then not In_Inlined_Body
             then
                --  We are dealing with a potentially unused use_package_clause
 
@@ -9865,6 +9866,7 @@
 
         and then not Spec_Reloaded_For_Body
         and then not In_Instance
+        and then not In_Inlined_Body
       then
          --  The type already has a use clause
 

Reply via email to