diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-08-27 19:13:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 19:13:27 -0700 |
commit | 656d5aa95825515a55ded61f19d41053c850c82d (patch) | |
tree | 446603cac89a64d6c50a91f9f44bf086f9e50e8b /clang/lib/Format/WhitespaceManager.cpp | |
parent | 815bf0f190383e14068f191bb0d16d62fbb6f8b3 (diff) | |
download | llvm-656d5aa95825515a55ded61f19d41053c850c82d.zip llvm-656d5aa95825515a55ded61f19d41053c850c82d.tar.gz llvm-656d5aa95825515a55ded61f19d41053c850c82d.tar.bz2 |
[clang-format] Fix misalignments of pointers in angle brackets (#106013)
Fixes #105898.
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r-- | clang/lib/Format/WhitespaceManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index a31874a..fd4a40a 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -469,7 +469,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End, // except if the token is equal, then a space is needed. if ((Style.PointerAlignment == FormatStyle::PAS_Right || Style.ReferenceAlignment == FormatStyle::RAS_Right) && - CurrentChange.Spaces != 0 && CurrentChange.Tok->isNot(tok::equal)) { + CurrentChange.Spaces != 0 && + !CurrentChange.Tok->isOneOf(tok::equal, tok::r_paren, + TT_TemplateCloser)) { const bool ReferenceNotRightAligned = Style.ReferenceAlignment != FormatStyle::RAS_Right && Style.ReferenceAlignment != FormatStyle::RAS_Pointer; |