diff mbox series

[Ada] Remove spurious warning on useless use-clauses in GNATprove

Message ID 20171108134631.GA128175@adacore.com
State New
Headers show
Series [Ada] Remove spurious warning on useless use-clauses in GNATprove | expand

Commit Message

Pierre-Marie de Rodat Nov. 8, 2017, 1:46 p.m. UTC
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  <moy@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.
diff mbox series

Patch

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