]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Add warning on redundant others_clause in array aggregate
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 13:05:49 +0000 (13:05 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 13:05:49 +0000 (13:05 +0000)
commit92ca4733448ed08deceb24dc8a809734660a333d
treec70a303f0872fe365859f4ad242d0978dd905b84
parent2da0687d17d0e0e3678ea83b458c22e0d6f3e61a
[Ada] Add warning on redundant others_clause in array aggregate

This patch adds a warning on a redundant others_clause in an array aggregate
when all index positions are already specified in previous positional or named
associations. The warning is emitted when Warn_On_Redundant_Constructs is
enabled.

2018-05-24  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_aggr.adb (Flatten): Add a warning on an others clause in an array
aggregate with static bounds when named associations cover all index
positions and the others clause is redundant.

gcc/testsuite/

* gnat.dg/others1.adb: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260657 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/others1.adb [new file with mode: 0644]