[clang] [clang-format] Improve annotating star and amp (PR #194190)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 26 12:05:51 PDT 2026


HazardyKnusperkeks wrote:

> Can we do the following instead?
> 
> ```diff
> --- a/clang/lib/Format/UnwrappedLineParser.cpp
> +++ b/clang/lib/Format/UnwrappedLineParser.cpp
> @@ -2741,6 +2741,7 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType,
>      case tok::kw_requires:
>        parseRequiresExpression();
>        break;
> +    case tok::amp:
>      case tok::ampamp:
>        if (AmpAmpTokenType != TT_Unknown)
>          FormatTok->setFinalizedType(AmpAmpTokenType);
> ```

We can, but we also need it for `tok::star` and I don't know which way is better.

https://github.com/llvm/llvm-project/pull/194190


More information about the cfe-commits mailing list