<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76399>76399</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy: provide a method for checks to produce self-diagnostic messages
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
daltairwalter
</td>
</tr>
</table>
<pre>
Many of the clang-tidy checks are for situations that ideally are fairly nuanced and apply only in specific situations. It would be useful to have a standard way to make self-diagnostic messages for checks so that they can reveal why they are choosing to add fixes in certain places or ignore others. These self-diagnostic messages would be messages that the user would typically not be interested in, unless the check is not working as intended, and would also still be available when the check sees the code as already correct.
I am particularly interested in this for #70621 where there is a significant amount of determining that needs to be done to decide if the check should produce a warning/fix or not. Currently, I am creating this check with the self-diagnostic messages being mixed into the normal user diag messages which is a source of review objection and I agree with the reviewer - this is not ideal.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lM9u4zgMxp_GuRAJbDl_JgcfujMI0MPe9gVoibG4laVAopP67Re0s20uM5c2kMVP38cfJSyFh0jUVYe_qsOvDU7iU-4cBkHODwxCedMnN3d_Y5whXUE8gQ0Yh62wm8F6sh8FMBNcU4bCMqFwigXEowA7whDm9TtyDjPECaMlBxgd4O0WZkgxzMARyo0sX9m-qOwA3gUeaQoOeoKp0HUKIAk83gkQimB0mB08cNblET8ICoXr1jEOMRVhCyOVggOVxeHTcEmrQfE0g8UIme6EAR5-XtfUsfUpFY6DKqNzcOVPKurUUhbkCLeAlgqkDDzElAmSeMrq-h9P5Q9OvhJ9rfzvRjPm53eZb2yX_sUkupujUKYi5IBjZX7CFAOVskLRYMBl2ftI-UONY1lqoiOn27XnqzSGkqAIh6C6eEcO2AeCh6f4IleInurJkaphyITKPeVMVnZV_auq39a_74Aj3DAL2ylgXqC--AXxvDKoTHuqj6bR0zKpfiZ1jqDTqCOAUQDHNEXRmXMklEeOCwrtUyRyRan0BC5F0p-OLDsCvr7a90vYW05usjovD8yqUpnLlT9BwcUkO4CfU84UJczapSWHzYSyHsjlKfdg8Yv6b7n2pCUjfy6JJS27Y8ojhhWsFr2MgWfrn8nTlC1p2kx3pgek_l-yegkWau-AQyb6trDuogzb1eET_HLhnlQ2rmvduT3jhrrmVLfHpjntm43vTsdD3xzxx4Gw7c9HVyOdXdu4Fpva7JvDhjtTm7Yx5ticzLludvsj2X1_Rtvuf5xc31T7mkbksAvhPu5SHjZcykTd6diez5uAPYWyvCnGfD8WlTH6xuROi7b9NJRqXwcuUr5lhCVQ91LTvim-u6JFGEl8cq_3WNIX3d9B2Uw5dF7kVqr2rTKXylwGFj_1O5vGylz07Oe_7S0n7XplLkueUpnLEum_AAAA__9HytHk">