[Ada] Misleading warning on variable not assigned
authorEd Schonberg <schonberg@adacore.com>
Mon, 22 Jul 2019 13:57:51 +0000 (13:57 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 22 Jul 2019 13:57:51 +0000 (13:57 +0000)
commit8c029ee8cf5d14e8c0dc0a74d9a5278c3aee49e9
treebe97ea27ba1cc2459f91ff6d462cf35ca3ce0519
parent22862ba6d688c95d9f9577746d212183a11c44da
[Ada] Misleading warning on variable not assigned

This patch removes a warning on a referenced entity with no explicit
prior assignment, if the type of the entity has
Preelaborable_Initialixation, such as Exception_Occurrence.

2019-07-22  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_warn.adb (Check_References): Do not emit s warning on a
referenced entity with no explicit assignment if the type of the
entity has Preelaborable_Initialixation, such as
Exception_Occurrence.

gcc/testsuite/

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

From-SVN: r273686
gcc/ada/ChangeLog
gcc/ada/sem_warn.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/warn25.adb [new file with mode: 0644]