Issue 87907
Summary [clang-format] Incorrect formatting when function is named instanceof
Labels clang-format
Assignees
Reporter kociap
    My .clang-format contains 
```
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: false
SpaceAfterTemplateKeyword: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
```
which should result in parentheses after function identifier being stuck to the identifier.

In the following snippet
```cpp
struct Value;

template<typename T>
[[nodiscard]] bool instanceof (Value const* value);

void replace_uses_with(Value* value, Value* replacement);
```
clang-format insists on erroneously inserting a space after the identifier `instanceof`, but does not do so in the case of `replace_uses_with`. This seems to happen only with `instanceof`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to