<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/142112>142112</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] misc-confusable-identifiers ignores -header-filter option
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ottml
</td>
</tr>
</table>
<pre>
When using the clang tidy check **misc-confusable-identifiers** the option -header-filter is ignored. The warnings from the files not matching the header-filter are always displayed and not suppressed. This works perfectly for the check **google-explicit-constructor** shown by the example below.
**Ubuntu LLVM version 18.1.3**
The problem can be reproduced by the following example:
main.cpp:
```
#include "header1.h"
namespace AI{
const int val = 10;
}
int main(int c, char** v)
{
return 0;
}
```
header1.h:
```
class A { A(int); };
namespace A1
{
void printi();
}
```
Output from clang-tidy with misc-confusable-identifiers:
```
clang-tidy-18 -checks='-*,misc-confusable-identifiers' -header-filter='ignore_all' main.cpp -p=../build/
1 warning generated.
/home/...../example/main/main.cpp:3:11: warning: 'AI' is confusable with 'A1' [misc-confusable-identifiers]
3 | namespace AI{
| ^
/home/...../example/main/header1.h:3:11: note: other declaration found here
3 | namespace A1
| ^
```
Output from clang-tidy with google-explicit-constructor:
```
clang-tidy-18 -checks='-*,google-explicit-constructor' -header-filter='ignore_all' m
ain.cpp -p=../build/
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVVGvozgP_TXpiwUioZT2gQfu9EMaaT7tw-7sPq5CYkp2QoKS0E7__SpAp7139lZXgyoVYR_bxzmxuffqZBArUryQ4rjhU-itq2wIg960Vl6rv3o0MHllThB6BKF5fFPyCqJH8Q0IqwmrB-VFIqzpJs9bjYmSaILqFDq_OMxgOwZlDSQ9coku6ZQO6EB5UCdjHcoU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