[gcc r12-5743] [Ada] Fix obsolete array aggregate warning being triggered by expanded code

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Thu Dec 2 16:29:59 GMT 2021


https://gcc.gnu.org/g:5a35fe64c7a89935599af3d4693494ca4578cd7f

commit r12-5743-g5a35fe64c7a89935599af3d4693494ca4578cd7f
Author: Marc Poulhiès <poulhies@adacore.com>
Date:   Fri Nov 26 10:49:51 2021 +0100

    [Ada] Fix obsolete array aggregate warning being triggered by expanded code
    
    gcc/ada/
    
            * sem_aggr.adb (Resolve_Array_Aggregate): Filter out nodes not
            coming from source before emitting the warning.

Diff:
---
 gcc/ada/sem_aggr.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 0d4af65e8a6..6e76e3d3c4d 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1807,6 +1807,7 @@ package body Sem_Aggr is
         and then not Is_Enum_Array_Aggregate (N)
         and then Is_Parenthesis_Aggregate (N)
         and then Nkind (Parent (N)) /= N_Qualified_Expression
+        and then Comes_From_Source (N)
       then
          Error_Msg_N
            ("?j?array aggregate using () is an" &


More information about the Gcc-cvs mailing list