<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/87202>87202</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy misreports indentation with tabs and spaces
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          orangebowlerhat
      </td>
    </tr>
</table>

<pre>
    clang-tidy sometimes reports the non-matching indent on if-else where the indentation is correct.

I'm using tabs for indents, 4 characters wide. The `if` and `else` have the same number of tabs. However the `else` had a stray space after one of the tabs. This does not change the indentation at all, but clang-tidy reports it as a mismatch.

This code -
```
int foo(bool b) {
        if (b)
                return 42;
        else
                return 0;
}

```
Produces this warning -
```
$ clang-tidy --checks=readability-misleading-indentation test.cpp
1 warning generated.
test.cpp:4:3: warning: different indentation for 'if' and corresponding 'else' [readability-misleading-indentation]
    4 | else
      |         ^
```

AFAIK there is no case in which the space could cause the indentation not to match. Tabs have to be at least one character wide. So while the indentation is not the same characters, it does not mismatch or mislead.

See also https://github.com/clangd/clangd/issues/1987

Forgive me if this is already resolved, I did look but couldn't find anything which looked the same.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVN1uqzgQfhrnZpQITAhwwUV6utFWe7PS6QsYewDvMXbkMY369isbktJttQdFBNvz52--bwSRHixiy8onVj7vxBxG51vnhR2wczeDfhRh1zn13koj7LAPWr0DuQmDnpDA49X5QBBGBOvsfhJBjtoOoK1CG8BZ0P0eDSHcRvSYDJczEXQ8JZDOe5ThwLJnlp2X9wvj1QQzxVBBdAS986sfMf4DjiBH4YUM6AluWuEBXkcEdsp0z04ZCKviIiaOy1G8LalJTAh2njr04PoU-gB_uhu-oU8Gn5wUCKDgxTvQVUgE0YfoZzH5jrj6v46aQDkksC7Ewuzw9aIigDAm1t7NATZg3iHUAQSBgElTQv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