[Ada] Remove confusing warning on type export

Message ID 20210503092945.GA77527@adacore.com
State New
Headers show
Series
  • [Ada] Remove confusing warning on type export
Related show

Commit Message

Pierre-Marie de Rodat May 3, 2021, 9:29 a.m.
"exporting" a type may seem useless but is actually useful to set its
convention and sometimes its external name.

So simply remove this warning.

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

gcc/ada/

	* sem_prag.adb (Set_Exported): Do not warn on exporting a type.

Patch

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10934,10 +10934,6 @@  package body Sem_Prag is
             end if;
          end if;
 
-         if Warn_On_Export_Import and then Is_Type (E) then
-            Error_Msg_NE ("exporting a type has no effect?x?", Arg, E);
-         end if;
-
          if Warn_On_Export_Import and Inside_A_Generic then
             Error_Msg_NE
               ("all instances of& will have the same external name?x?",