diff options
author | Steve Baird <baird@adacore.com> | 2022-05-24 14:09:14 -0700 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-04 07:45:54 +0000 |
commit | f7c05e82037356ac4610e9e5d1365b345a17d0f7 (patch) | |
tree | fcc31852c5d7045342defa872ea420dc03c937cf /gcc/ada/debug.adb | |
parent | e7428fff12ca000b59185c71dee511ac0c886089 (diff) | |
download | gcc-f7c05e82037356ac4610e9e5d1365b345a17d0f7.zip gcc-f7c05e82037356ac4610e9e5d1365b345a17d0f7.tar.gz gcc-f7c05e82037356ac4610e9e5d1365b345a17d0f7.tar.bz2 |
[Ada] Avoid unwanted warnings for statically-known-successful assertions
The -gnatwc switch enables warnings for test condition outcomes that are
known at compile time. Such warnings are unlikely to be useful in the
case of an assertion expression (or a subexpression thereof), so do not
generate them in that case.
gcc/ada/
* sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
generate a warning if the expression in question is an assertion
expression, or a subexpression thereof. But do call
Test_Comparison so that it can generate warnings for the cases
that it generates warnings for.
* sem_prag.ads: Modify Assertion_Expression_Pragma constant so
that the predicate Sem_Util.In_Assertion_Expression_Pragma
returns True for the expression of a Compile_Time_Error pragma.
Diffstat (limited to 'gcc/ada/debug.adb')
0 files changed, 0 insertions, 0 deletions