Skip to content
Commit a0ddf5fc authored by Alexander Kornienko's avatar Alexander Kornienko
Browse files

[clang-tidy] readability-braces-around-statements false positive with char literals

Summary:
Single-line if statements cause a false positive when the last token in the conditional statement is a char constant:

```
if (condition)
  return 'a';
```

For some reason `findEndLocation` seems to skips too many (vertical) whitespaces in this case. The same problem already occured with string literals (https://reviews.llvm.org/D25558), and was fixed by adding a special check for this very case. I just extended the condition to also include char constants. No idea what really causes the issue though.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

Patch by Florian Gross!
Differential Revision: https://reviews.llvm.org/D33354

llvm-svn: 303551
parent 68ae83e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment