]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/sem_aggr.adb
2011-08-02 Yannick Moy <moy@adacore.com>
[thirdparty/gcc.git] / gcc / ada / sem_aggr.adb
index 566995d4cfd5222f37189e00fdd0ae6884c17fbf..131379f33b62a8a7d43cb7d1daec33609703e5eb 100644 (file)
@@ -993,10 +993,12 @@ package body Sem_Aggr is
          if Is_Array_Type (Typ)
            and then Nkind (Parent (N)) = N_Assignment_Statement
            and then not Is_Constrained (Etype (Name (Parent (N))))
-           and then not Is_Others_Aggregate (N)
          then
-            Check_Formal_Restriction
-              ("array aggregate should have only OTHERS", N);
+            if not Is_Others_Aggregate (N) then
+               Check_Formal_Restriction
+                 ("array aggregate should have only OTHERS", N);
+            end if;
+
          elsif Is_Top_Level_Aggregate (N) then
             Check_Formal_Restriction ("aggregate should be qualified", N);