[clang] [clang-format] Don't insert a space between :: and * (PR #105043)
kadir çetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 22 02:25:55 PDT 2024
================
@@ -4589,9 +4589,12 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
if (!BeforeLeft)
return false;
if (BeforeLeft->is(tok::coloncolon)) {
- const auto *Prev = BeforeLeft->Previous;
- return Left.is(tok::star) && Prev &&
- !Prev->endsSequence(tok::identifier, TT_FunctionTypeLParen);
+ if (Left.isNot(tok::star))
+ return false;
+ if (!Right.startsSequence(tok::identifier, tok::r_paren))
+ return true;
+ const auto *Tok = Right.Next->MatchingParen;
----------------
kadircet wrote:
`Right.Next` might be nullptr
https://github.com/llvm/llvm-project/pull/105043
More information about the cfe-commits
mailing list