You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang-format] Fix repeated backslash insertion in macro line comments
Line comments in preprocessor directives were incorrectly marked as
continuing the directive, causing clang-format to add backslashes
after them on repeated runs. Backslashes appended after line comments in
this way do not continue the PP directive because the following line
would also become part of the comment.
Fix by unsetting InPPDirective in WhitespaceManager::replaceWhitespace
for line comments in two places: when breaking lines and when formatting
tokens on the same line. This stops the spurious backslash insertion for
both standalone line comments after PP directives and trailing line
comments after macro bodies.
Fixes#164282.
Co-authored-by: Björn Schäpers <[email protected]>
Signed-off-by: Ruoyu Zhong <[email protected]>
0 commit comments