[clang] [clang-format] Don't insert a space between :: and * (PR #105043)
kadir çetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 20 11:35:59 PDT 2024
================
@@ -4591,7 +4589,9 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
if (!BeforeLeft)
return false;
if (BeforeLeft->is(tok::coloncolon)) {
- return Left.is(tok::star) &&
+ const auto *Prev = BeforeLeft->Previous;
+ return Left.is(tok::star) && Prev &&
+ !Prev->endsSequence(tok::identifier, TT_FunctionTypeLParen) &&
Style.PointerAlignment != FormatStyle::PAS_Right;
----------------
kadircet wrote:
nit: i think `PointerAlignment` is always `non-right` when we get here, as we bail out on line `4577` when pointer alignment is right (or it's derived to be right).
https://github.com/llvm/llvm-project/pull/105043
More information about the cfe-commits
mailing list