Aspects Import and Export were not treated like the equivalent pragmas
wrt issuing warnings on missing initialization before use. Now fixed.

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

2014-06-13  Yannick Moy  <m...@adacore.com>

        * sem_ch13.adb (Analyze_Aspect_Specifications/Aspect_Import,
        Aspect_Export): Consider that variables may be set outside the program.

Index: sem_ch13.adb
===================================================================
--- sem_ch13.adb        (revision 211609)
+++ sem_ch13.adb        (working copy)
@@ -1603,7 +1603,7 @@
                      goto Continue;
                   end if;
 
-                  --  For case of address aspect, we don't consider that we
+                  --  For the case of aspect Address, we don't consider that we
                   --  know the entity is never set in the source, since it is
                   --  is likely aliasing is occurring.
 
@@ -2691,6 +2691,19 @@
 
                   elsif A_Id = Aspect_Import or else A_Id = Aspect_Export then
 
+                     --  For the case of aspects Import and Export, we don't
+                     --  consider that we know the entity is never set in the
+                     --  source, since it is is likely modified outside the
+                     --  program.
+
+                     --  Note: one might think that the analysis of the
+                     --  resulting pragma would take care of that, but
+                     --  that's not the case since it won't be from source.
+
+                     if Ekind (E) = E_Variable then
+                        Set_Never_Set_In_Source (E, False);
+                     end if;
+
                      --  Verify that there is an aspect Convention that will
                      --  incorporate the Import/Export aspect, and eventual
                      --  Link/External names.

Reply via email to