[all-commits] [llvm/llvm-project] dd47b8: [clang-format] Handle Trailing Whitespace After Li...
Naveen Seth Hanig via All-commits
all-commits at lists.llvm.org
Wed Jun 25 09:13:22 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: dd47b845a62cdaf4a1b0aba354cd80a4eabd9570
https://github.com/llvm/llvm-project/commit/dd47b845a62cdaf4a1b0aba354cd80a4eabd9570
Author: Naveen Seth Hanig <naveen.hanig at outlook.com>
Date: 2025-06-25 (Wed, 25 Jun 2025)
Changed paths:
M clang/lib/Format/FormatTokenLexer.cpp
M clang/unittests/Format/FormatTest.cpp
Log Message:
-----------
[clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (#145243)
Fixes #145226.
Implement
[P2223R2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf)
in clang-format to correctly handle cases where a backslash '\\' is
followed by trailing whitespace before the newline.
Previously, `clang-format` failed to properly detect and handle such
cases, leading to misformatted code.
With this, `clang-format` matches the behavior already implemented in
Clang's lexer and `DependencyDirectivesScanner.cpp`, which allow
trailing whitespace after a line continuation in any C++ standard.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list