Issue 185108
Summary [clang-tidy] Fix-it for `readability-redundant-parentheses` results in incorrect syntax
Labels clang-tidy
Assignees
Reporter StardustGogeta
    The new `readability-redundant-parentheses` check proposes fix-its that simply remove the parentheses in question, ignoring spacing. This can result in broken behavior, such as in the following example:
```
int func() {
 return(0);
}
```
Applying the suggested fix yields the following:
```
int func() {
    return0;
}
```
This is clearly a syntax error.

The correct fix should account for whitespace (or the lack thereof) and make sure not to combine adjacent tokens as a result of the parenthesis removal.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to