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. Tested on x86_64-pc-linux-gnu, committed on trunk 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.