ada: Spurious warning about negative modular literal
commitbed30418f910df5ea605b7f5ee4b86a6ab7e9411
authorSteve Baird <baird@adacore.com>
Thu, 10 Aug 2023 22:39:01 +0000 (10 15:39 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 5 Sep 2023 11:05:13 +0000 (5 13:05 +0200)
tree593e6724edab2dad16a1aeccfafd6660683322b2
parent46644c3fd7c2c6baf1bfde0734bfd50975faa1c4
ada: Spurious warning about negative modular literal

If -gnatw.m is enabled, the compiler generates a warning if a unary
minus operator of a modular type is applied to an integer literal.
This warning was being incorrectly generated in some cases where no integer
literal is present in the source code.

gcc/ada/

* sem_res.adb (Resolve_Unary_Op): In deciding whether to emit a
warning about a modular type's unary minus operator being applied
to an integer literal, ignore integer literals for which
Comes_From_Source is False.
gcc/ada/sem_res.adb