[clang] [clang-format] Remove obsolete code (PR #220080)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 23:53:14 PDT 2026
owenca wrote:
> I would do this instead:
>
> ```diff
> --- a/clang/lib/Format/TokenAnnotator.cpp
> +++ b/clang/lib/Format/TokenAnnotator.cpp
> @@ -2336,7 +2336,7 @@ private:
> for (FormatToken *Previous = Current.Previous;
> Previous && Previous->isOneOf(tok::star, tok::amp);
> Previous = Previous->Previous) {
> - Previous->setType(TT_PointerOrReference);
> + Previous->setFinalizedType(TT_PointerOrReference);
> }
> if (Line.MustBeDeclaration &&
> Contexts.front().ContextType != Context::CtorInitializer) {
> ```
>
> IMO, this is more conservative and serves a catch-all for uncovered edge cases.
Also, it would obsolete #212856, which caused the regression in #222132.
https://github.com/llvm/llvm-project/pull/220080
More information about the cfe-commits
mailing list